PR20991: ::decltype is not valid.

llvm-svn: 219043
This commit is contained in:
Richard Smith 2014-10-04 01:57:39 +00:00
parent 7e26a67ffa
commit a9d100178c
2 changed files with 7 additions and 1 deletions

View File

@ -242,7 +242,8 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
*MayBePseudoDestructor = false;
}
if (Tok.is(tok::kw_decltype) || Tok.is(tok::annot_decltype)) {
if (!HasScopeSpecifier &&
(Tok.is(tok::kw_decltype) || Tok.is(tok::annot_decltype))) {
DeclSpec DS(AttrFactory);
SourceLocation DeclLoc = Tok.getLocation();
SourceLocation EndLoc = ParseDecltypeSpecifier(DS);

View File

@ -116,6 +116,11 @@ namespace DuplicateSpecifier {
};
}
namespace ColonColonDecltype {
struct S { struct T {}; };
::decltype(S())::T invalid; // expected-error {{expected unqualified-id}}
}
struct Base { virtual void f() = 0; virtual void g() = 0; virtual void h() = 0; };
struct MemberComponentOrder : Base {
void f() override __asm__("foobar") __attribute__(( )) {}