summaryrefslogtreecommitdiff
path: root/test/Parser
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-05-18 19:21:48 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-05-18 19:21:48 +0000
commit00ba534163277c871bd74e91b86aa5f079d6d0af (patch)
tree9783d3250304023eeab0e08253eced8aab96502a /test/Parser
parent3022dac388832e0bb669821e6677abd5cb8a8784 (diff)
Fix the location of "missing ';'" suggestions after annotation tokens.
We were incorrectly setting PrevTokLocation to the first token in the annotation token instead of the last when consuming it. To fix this without adding a complex switch to the hot path through ConsumeToken, we now have a ConsumeAnnotationToken function for consuming annotation tokens in addition to the other Consume*Token special case functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303372 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser')
-rw-r--r--test/Parser/cxx0x-decl.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp
index d912e19287..ba322a5894 100644
--- a/test/Parser/cxx0x-decl.cpp
+++ b/test/Parser/cxx0x-decl.cpp
@@ -123,6 +123,22 @@ namespace ColonColonDecltype {
::decltype(S())::T invalid; // expected-error {{expected unqualified-id}}
}
+namespace AliasDeclEndLocation {
+ template<typename T> struct A {};
+ // Ensure that we correctly determine the end of this declaration to be the
+ // end of the annotation token, not the beginning.
+ using B = AliasDeclEndLocation::A<int
+ > // expected-error {{expected ';' after alias declaration}}
+ +;
+ // FIXME: After splitting this >> into two > tokens, we incorrectly determine
+ // the end of the template-id to be after the *second* '>'.
+ // Perhaps we could synthesize an expansion FileID containing '> >' to fix this?
+ using C = AliasDeclEndLocation::A<int
+ >\
+> // expected-error {{expected ';' after alias declaration}}
+ ;
+}
+
struct Base { virtual void f() = 0; virtual void g() = 0; virtual void h() = 0; };
struct MemberComponentOrder : Base {
void f() override __asm__("foobar") __attribute__(( )) {}