llvm-project/clang/lib
Volodymyr Sapsai 9f7b5cc073 [Parser] Fix assertion-on-invalid for unexpected typename.
In `ParseDeclarationSpecifiers` for the code

    class A typename A;

we were able to annotate token `kw_typename` because it refers to
existing type. But later during processing token `annot_typename` we
failed to `SetTypeSpecType` and exited switch statement leaving
annotation token unconsumed. The code after the switch statement failed
because it didn't expect a special token.

The fix is not to assume that switch statement consumes all special
tokens and consume any token, not just non-special.

rdar://problem/37099386

Reviewers: rsmith, arphaman

Reviewed By: rsmith

Subscribers: jkorous-apple, cfe-commits

Differential Revision: https://reviews.llvm.org/D44449

llvm-svn: 329735
2018-04-10 18:29:47 +00:00
..
ARCMigrate Fix typos in clang 2018-04-06 15:14:32 +00:00
AST [ExprConstant] Use an AST node and a version number as a key to create 2018-04-10 05:15:01 +00:00
ASTMatchers Fix typos in clang 2018-04-06 15:14:32 +00:00
Analysis Revert "[analyzer] Remove an unused variable" 2018-04-06 19:14:05 +00:00
Basic Attempt to fix Windows build after r329698. 2018-04-10 14:08:25 +00:00
CodeGen -ftime-report switch support in Clang. 2018-04-10 10:34:13 +00:00
CrossTU [CrossTU] Fix handling of Cross Translation Unit directory path 2017-10-27 12:53:37 +00:00
Driver [XRay][llvm+clang] Consolidate attribute list files 2018-04-09 04:02:09 +00:00
Edit [Edit, Rewrite] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-27 00:01:49 +00:00
Format Fix typos in clang 2018-04-06 15:14:32 +00:00
Frontend Use llvm::sys::fs::real_path() in clang. 2018-04-10 13:36:38 +00:00
FrontendTool Make a build bot happy. 2018-02-10 14:26:53 +00:00
Headers Fix typos in clang 2018-04-06 15:14:32 +00:00
Index [Index] Return SourceLocation to consumers, not FileID/Offset pair. 2018-04-09 14:12:51 +00:00
Lex -ftime-report switch support in Clang. 2018-04-10 10:34:13 +00:00
Parse [Parser] Fix assertion-on-invalid for unexpected typename. 2018-04-10 18:29:47 +00:00
Rewrite [Edit, Rewrite] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-27 00:01:49 +00:00
Sema -ftime-report switch support in Clang. 2018-04-10 10:34:13 +00:00
Serialization [ObjC++] Never pass structs that transitively contain __weak fields in 2018-04-09 22:48:22 +00:00
StaticAnalyzer Sort source lists in lib/StaticAnalyzer. 2018-04-07 04:25:01 +00:00
Tooling [Tooling] fix UB when interpolating compile commands with an empty index 2018-04-10 10:36:46 +00:00
CMakeLists.txt Add Cross Translation Unit support library 2017-09-22 11:11:01 +00:00