summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-02-16 22:32:46 +0000
committerNico Weber <nicolasweber@gmx.de>2015-02-16 22:32:46 +0000
commitc60aa71aa2892b5aa64b303109b29725b1b4aa94 (patch)
tree013f483b2a41fb488a54771f2d8ec7c8772becc4 /clang/lib/Sema/SemaExprCXX.cpp
parentbf2b90e92d6be234ac5eca7707a51b3d9107d91c (diff)
downloadbcm5719-llvm-c60aa71aa2892b5aa64b303109b29725b1b4aa94.tar.gz
bcm5719-llvm-c60aa71aa2892b5aa64b303109b29725b1b4aa94.zip
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
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud