diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2014-07-22 01:54:49 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2014-07-22 01:54:49 +0000 |
commit | b4b3578af7d013f5fe4f4bb323bc52bc2991ae33 (patch) | |
tree | 9dee5bba1b1f8b11e4ab3ab09a3a33178226c2bd /clang/lib/Parse/ParseCXXInlineMethods.cpp | |
parent | 1a711b169619e1109cb9affed650f8f12ae85f6e (diff) | |
download | bcm5719-llvm-b4b3578af7d013f5fe4f4bb323bc52bc2991ae33.tar.gz bcm5719-llvm-b4b3578af7d013f5fe4f4bb323bc52bc2991ae33.zip |
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
Diffstat (limited to 'clang/lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r-- | clang/lib/Parse/ParseCXXInlineMethods.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp index 310e2b4cd8a..30a9120a510 100644 --- a/clang/lib/Parse/ParseCXXInlineMethods.cpp +++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp @@ -337,7 +337,8 @@ void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) { } else DefArgResult = ParseAssignmentExpression(); if (DefArgResult.isInvalid()) - Actions.ActOnParamDefaultArgumentError(LM.DefaultArgs[I].Param); + Actions.ActOnParamDefaultArgumentError(LM.DefaultArgs[I].Param, + EqualLoc); else { if (!TryConsumeToken(tok::cxx_defaultarg_end)) { // The last two tokens are the terminator and the saved value of |