llvm-project/clang/lib/Parse
Nico Weber cfaa4cdc35 Don't crash on `struct ::, struct ::` (and the same for enums).
The first part of that line doesn't parse correctly and ParseClassSpecifier() for
some reason skips to tok::comma to recover, and then
ParseDeclarationSpecifiers() sees the next struct and calls
ParseClassSpecifier() again with the same DeclSpec object.

However, the first call already called ActOnCXXGlobalScopeSpecifier() on the
DeclSpec's CXXScopeSpec, and sema gets confused when this gets called again.

As a fix, let ParseClassSpecifier() (and ParseEnumSpecifier()) call
ParseOptionalCXXScopeSpec() with a temporary CXXScopeSpec object, and only
copy it into the DeclSpec if things work out.  (This is also how all the other
functions that set the DeclSpec's TypeSpecScope set it.)

Found by SLi's bot.

llvm-svn: 229288
2015-02-15 07:26:13 +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 Don't crash on `struct ::, struct ::` (and the same for enums). 2015-02-15 07:26:13 +00:00
ParseExpr.cpp Wrap to 80 columns. No behavior change. 2015-02-02 05:38:59 +00:00
ParseExprCXX.cpp Wrap to 80 columns. No behavior change. 2015-02-15 06:15:40 +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 Header guard canonicalization, clang part. 2014-08-13 16:25:19 +00:00