aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-21 17:05:03 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-21 17:05:03 +0000
commit1e054213f8416a48866105216ad4a45f1e7c24de (patch)
tree0284b6ecd9991dd37eb14bdf49fe6baf0495c9b0
parentc19f959d7fa5303f2fff5fa7a4968361cb7ef068 (diff)
Consider nested-names as part of the declarator when resolving an ambiguous statement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76583 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Parse/ParseTentative.cpp6
-rw-r--r--test/SemaCXX/dcl_ambig_res.cpp7
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp
index 97f6f526d4..8b0d400b5b 100644
--- a/lib/Parse/ParseTentative.cpp
+++ b/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/test/SemaCXX/dcl_ambig_res.cpp b/test/SemaCXX/dcl_ambig_res.cpp
index 57bf4095af..c392647a3b 100644
--- a/test/SemaCXX/dcl_ambig_res.cpp
+++ b/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}}
+}