[cfe-commits] r171908 - in /cfe/trunk: lib/Parse/ParseDecl.cpp test/Parser/cxx0x-decl.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Tue Jan 8 14:43:49 PST 2013
Author: rsmith
Date: Tue Jan 8 16:43:49 2013
New Revision: 171908
URL: http://llvm.org/viewvc/llvm-project?rev=171908&view=rev
Log:
PR14855: don't silently swallow a nested-name-specifier after a type name.
Modified:
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/test/Parser/cxx0x-decl.cpp
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=171908&r1=171907&r2=171908&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Tue Jan 8 16:43:49 2013
@@ -4189,7 +4189,11 @@
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;
Modified: cfe/trunk/test/Parser/cxx0x-decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx0x-decl.cpp?rev=171908&r1=171907&r2=171908&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx0x-decl.cpp (original)
+++ cfe/trunk/test/Parser/cxx0x-decl.cpp Tue Jan 8 16:43:49 2013
@@ -39,3 +39,5 @@
struct SS {
typedef void d() = default; // expected-error {{function definition declared 'typedef'}} expected-error {{only special member functions may be defaulted}}
};
+
+using PR14855 = int S::; // expected-error {{expected ';' after alias declaration}}
More information about the cfe-commits
mailing list