From 33c70c9388b89c9f493d3ed9dc6120b4d95a5de0 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 21 Jul 2009 17:05:03 +0000 Subject: [PATCH] Consider nested-names as part of the declarator when resolving an ambiguous statement. llvm-svn: 76583 --- clang/lib/Parse/ParseTentative.cpp | 6 +++++- clang/test/SemaCXX/dcl_ambig_res.cpp | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp index 97f6f52..8b0d400 100644 --- a/clang/lib/Parse/ParseTentative.cpp +++ b/clang/lib/Parse/ParseTentative.cpp @@ -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(); diff --git a/clang/test/SemaCXX/dcl_ambig_res.cpp b/clang/test/SemaCXX/dcl_ambig_res.cpp index 57bf409..c392647 100644 --- a/clang/test/SemaCXX/dcl_ambig_res.cpp +++ b/clang/test/SemaCXX/dcl_ambig_res.cpp @@ -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}} +} -- 2.7.4