r218780 - c++ error recovery. Build a valid AST when trying
Fariborz Jahanian
fjahanian at apple.com
Wed Oct 1 11:03:51 PDT 2014
Author: fjahanian
Date: Wed Oct 1 13:03:51 2014
New Revision: 218780
URL: http://llvm.org/viewvc/llvm-project?rev=218780&view=rev
Log:
c++ error recovery. Build a valid AST when trying
to recover from parse error parsing the default
argument. Patch prevents crash after spewing 100s
of errors caused by someone who forgot to compile in c++11
mode. So no test. rdar://18508589
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=218780&r1=218779&r2=218780&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Oct 1 13:03:51 2014
@@ -353,7 +353,9 @@ void Sema::ActOnParamDefaultArgumentErro
Param->setInvalidDecl();
UnparsedDefaultArgLocs.erase(Param);
Param->setDefaultArg(new(Context)
- OpaqueValueExpr(EqualLoc, Param->getType(), VK_RValue));
+ OpaqueValueExpr(EqualLoc,
+ Param->getType().getNonReferenceType(),
+ VK_RValue));
}
/// CheckExtraCXXDefaultArguments - Check for any extra default
More information about the cfe-commits
mailing list