]> granicus.if.org Git - clang/commitdiff
Consider nested-names as part of the declarator when resolving an ambiguous statement.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 21 Jul 2009 17:05:03 +0000 (17:05 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 21 Jul 2009 17:05:03 +0000 (17:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76583 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseTentative.cpp
test/SemaCXX/dcl_ambig_res.cpp

index 97f6f526d4061cc740d05af09473d54ba34420fd..8b0d400b5b8e8ad136c2893d40d5ed1b860a1b83 100644 (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();
index 57bf4095afd0a65e2dc1c1f7c3c0bf5185961127..c392647a3bd7395674ca99b2aefaa51f2ab1577d 100644 (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}}
+}