[cfe-commits] r76583 - in /cfe/trunk: lib/Parse/ParseTentative.cpp test/SemaCXX/dcl_ambig_res.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Tue Jul 21 10:05:25 PDT 2009
Author: akirtzidis
Date: Tue Jul 21 12:05:03 2009
New Revision: 76583
URL: http://llvm.org/viewvc/llvm-project?rev=76583&view=rev
Log:
Consider nested-names as part of the declarator when resolving an ambiguous statement.
Modified:
cfe/trunk/lib/Parse/ParseTentative.cpp
cfe/trunk/test/SemaCXX/dcl_ambig_res.cpp
Modified: cfe/trunk/lib/Parse/ParseTentative.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTentative.cpp?rev=76583&r1=76582&r2=76583&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTentative.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTentative.cpp Tue Jul 21 12:05:03 2009
@@ -427,8 +427,12 @@
// 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();
Modified: cfe/trunk/test/SemaCXX/dcl_ambig_res.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/dcl_ambig_res.cpp?rev=76583&r1=76582&r2=76583&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/dcl_ambig_res.cpp (original)
+++ cfe/trunk/test/SemaCXX/dcl_ambig_res.cpp Tue Jul 21 12:05:03 2009
@@ -64,3 +64,10 @@
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}}
+}
More information about the cfe-commits
mailing list