aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-01-08 22:43:49 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-01-08 22:43:49 +0000
commit6a502c4430088fe3bac7b5886cd9425f7e306b63 (patch)
tree3ce744818526bae32a57df902d85ffc6094bd49d /lib/Parse/ParseDecl.cpp
parentd130fd2e141f1fef412c2d58e7385370801bd718 (diff)
PR14855: don't silently swallow a nested-name-specifier after a type name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index fe92050694..86fc2d3a86 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -4189,7 +4189,11 @@ void Parser::ParseDeclaratorInternal(Declarator &D,
if (SS.isNotEmpty()) {
if (Tok.isNot(tok::star)) {
// The scope spec really belongs to the direct-declarator.
- D.getCXXScopeSpec() = SS;
+ if (D.mayHaveIdentifier())
+ D.getCXXScopeSpec() = SS;
+ else
+ AnnotateScopeToken(SS, true);
+
if (DirectDeclParser)
(this->*DirectDeclParser)(D);
return;