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)
commit9115f7255f489610de3cd3bb9e1a1aef66e38ae9
tree354d2a34c36648eb31479dfaf2f3c2d601ce233e
parente6de71dffb8ce404e22505f0e80015137437fde9
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213594 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Parse/ParseCXXInlineMethods.cpp
lib/Parse/ParseDecl.cpp
lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/default1.cpp