diff options
author | Volodymyr Sapsai <vsapsai@apple.com> | 2018-04-10 18:29:47 +0000 |
---|---|---|
committer | Volodymyr Sapsai <vsapsai@apple.com> | 2018-04-10 18:29:47 +0000 |
commit | 9f7b5cc073541fed33a50406f698a33f6e277363 (patch) | |
tree | 358b14abd218a1b2e164cf2d31614d481327c7f2 /clang/test/Parser/cxx-decl.cpp | |
parent | 442428540abbf5e07aa8be2f078bcc599a2259da (diff) | |
download | bcm5719-llvm-9f7b5cc073541fed33a50406f698a33f6e277363.tar.gz bcm5719-llvm-9f7b5cc073541fed33a50406f698a33f6e277363.zip |
[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
Diffstat (limited to 'clang/test/Parser/cxx-decl.cpp')
-rw-r--r-- | clang/test/Parser/cxx-decl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-decl.cpp b/clang/test/Parser/cxx-decl.cpp index 1a24520b8f5..e1b36ecfa93 100644 --- a/clang/test/Parser/cxx-decl.cpp +++ b/clang/test/Parser/cxx-decl.cpp @@ -298,6 +298,11 @@ inline namespace ParensAroundFriend { // expected-error 0-1{{C++11}} } } +namespace rdar37099386 { + class A typename A; // expected-error {{expected a qualified name after 'typename'}} + // expected-error@-1 {{cannot combine with previous 'class' declaration specifier}} +} + // PR8380 extern "" // expected-error {{unknown linkage language}} test6a { ;// expected-error {{C++ requires a type specifier for all declarations}} |