Avoid crash if default argument parsed with errors.
authorSerge Pavlov <sepavloff@gmail.com>
Tue, 22 Jul 2014 01:54:49 +0000 (01:54 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Tue, 22 Jul 2014 01:54:49 +0000 (01:54 +0000)
commitb4b3578af7d013f5fe4f4bb323bc52bc2991ae33
tree9dee5bba1b1f8b11e4ab3ab09a3a33178226c2bd
parent1a711b169619e1109cb9affed650f8f12ae85f6e
Avoid crash if default argument parsed with errors.

If function parameters have default values, and that of the second
parameter is parsed with errors, function declaration would have
a parameter without default value that follows a parameter with
that. Such declaration breaks logic of selecting overloaded
function. As a solution, put opaque object as default value in such case.

This patch fixes PR20055.

Differential Revision: http://reviews.llvm.org/D4378

llvm-svn: 213594
clang/include/clang/Sema/Sema.h
clang/lib/Parse/ParseCXXInlineMethods.cpp
clang/lib/Parse/ParseDecl.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/SemaCXX/default1.cpp