Consider nested-names as part of the declarator when resolving an ambiguous statement.

llvm-svn: 76583
This commit is contained in:
Argyrios Kyrtzidis 2009-07-21 17:05:03 +00:00
parent b61f9c8c8d
commit 33c70c9388
2 changed files with 12 additions and 1 deletions

View File

@ -427,8 +427,12 @@ Parser::TPResult Parser::TryParseDeclarator(bool mayBeAbstract,
// direct-declarator:
// direct-abstract-declarator:
if (Tok.is(tok::identifier) && mayHaveIdentifier) {
if ((Tok.is(tok::identifier) ||
(Tok.is(tok::annot_cxxscope) && NextToken().is(tok::identifier))) &&
mayHaveIdentifier) {
// declarator-id
if (Tok.is(tok::annot_cxxscope))
ConsumeToken();
ConsumeToken();
} else if (Tok.is(tok::l_paren)) {
ConsumeParen();

View File

@ -64,3 +64,10 @@ void foo7() {
void h7(int *(C7[10])) { } // expected-note{{previous}}
void h7(int *(*_fp)(C7 _parm[10])) { } // expected-error{{redefinition}}
struct S5 {
static bool const value = false;
};
int foo8() {
int v(int(S5::value)); // expected-warning{{disambiguated}} expected-error{{parameter declarator cannot be qualified}}
}