llvm-project/clang/lib/Parse
Nico Weber c60aa71aa2 For variables with dependent type, don't crash on `var->::new` or `var->__super`
ParsePostfixExpressionSuffix() for '->' (or '.') postfixes first calls
ActOnStartCXXMemberReference() to inform sema that a member reference is about
to start, and that function lets the parser know if sema thinks that the
base expression's type could allow a pseudo destructor from a semantic point of
view (for example, if the the base expression has a dependent type).

ParsePostfixExpressionSuffix() then calls ParseOptionalCXXScopeSpecifier() and
passes MayBePseudoDestructor on to that function, expecting the function to
set it to false if a pseudo destructor is impossible from a syntactic point of
view (due to a lack of '~' sigil).  However, ParseOptionalCXXScopeSpecifier()
had early-outs for ::new and __super, so MayBePseudoDestructor stayed true,
so we tried to parse a pseudo dtor, and then became confused since we couldn't
find a '~'.  Move the snippet in ParseOptionalCXXScopeSpecifier() that sets
MayBePseudoDestructor to false above the early exits.

Parts of this found by SLi's bot.

llvm-svn: 229449
2015-02-16 22:32:46 +00:00
..
CMakeLists.txt [CMake] Reorder libdeps by alphabetical order. 2014-07-14 04:59:27 +00:00
Makefile
ParseAST.cpp Remove unneeded include of DeclCXX.h from libParse. 2014-12-28 01:52:28 +00:00
ParseCXXInlineMethods.cpp Code cleanup 2015-01-30 14:21:35 +00:00
ParseDecl.cpp Don't crash on `struct ::, struct ::` (and the same for enums). 2015-02-15 07:26:13 +00:00
ParseDeclCXX.cpp Parse: return true from ParseCXX11AttributeArgs if an attribute was added 2015-02-16 22:26:52 +00:00
ParseExpr.cpp Fix typo in comment. 2015-02-16 21:21:12 +00:00
ParseExprCXX.cpp For variables with dependent type, don't crash on `var->::new` or `var->__super` 2015-02-16 22:32:46 +00:00
ParseInit.cpp Enable ActOnIdExpression to use delayed typo correction for non-C++ code 2014-11-21 18:48:04 +00:00
ParseObjc.cpp Modified the Objective-C lexer and parser (only 2014-12-09 23:47:56 +00:00
ParseOpenMP.cpp Enable ActOnIdExpression to use delayed typo correction for non-C++ code 2014-11-21 18:48:04 +00:00
ParsePragma.cpp Enable pragma comment processing for PS4. Original patch by Yunzhong Gao! 2015-01-28 18:26:15 +00:00
ParseStmt.cpp Initial support for Win64 SEH IR emission 2015-01-22 01:36:17 +00:00
ParseStmtAsm.cpp Adding option -fno-inline-asm to disallow inline asm 2015-01-16 23:05:28 +00:00
ParseTemplate.cpp Diagnose function template definitions inside functions 2014-12-15 23:16:32 +00:00
ParseTentative.cpp [PowerPC]To provide better compatibility with gcc I added the __bool keyword to the Alitivec support in clang. __bool is functionally identical to using bool when declaring vector types. For example: 2015-01-12 19:35:51 +00:00
Parser.cpp Parse: Get rid of tok::cxx_defaultarg_end, use EOF instead 2015-01-12 05:17:40 +00:00
RAIIObjectsForParser.h Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; Clang edition. 2015-02-15 22:54:08 +00:00