[llvm-branch-commits] [cfe-branch] r121556 - in /cfe/branches/Apple/whitney: lib/Parse/ParseTentative.cpp test/SemaCXX/dcl_ambig_res.cpp

Daniel Dunbar daniel at zuster.org
Fri Dec 10 13:37:56 PST 2010


Author: ddunbar
Date: Fri Dec 10 15:37:56 2010
New Revision: 121556

URL: http://llvm.org/viewvc/llvm-project?rev=121556&view=rev
Log:
Merge r121228:
--
Author: Argyrios Kyrtzidis <akyrtzi at gmail.com>
Date:   Wed Dec 8 02:02:46 2010 +0000

    Handle parameter attributes when tentative parsing for function/variable disambiguation.
    Fixes rdar://8739801.

Modified:
    cfe/branches/Apple/whitney/lib/Parse/ParseTentative.cpp
    cfe/branches/Apple/whitney/test/SemaCXX/dcl_ambig_res.cpp

Modified: cfe/branches/Apple/whitney/lib/Parse/ParseTentative.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Parse/ParseTentative.cpp?rev=121556&r1=121555&r2=121556&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Parse/ParseTentative.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Parse/ParseTentative.cpp Fri Dec 10 15:37:56 2010
@@ -1009,10 +1009,11 @@
 ///   parameter-declaration-list ',' parameter-declaration
 ///
 /// parameter-declaration:
-///   decl-specifier-seq declarator
-///   decl-specifier-seq declarator '=' assignment-expression
-///   decl-specifier-seq abstract-declarator[opt]
-///   decl-specifier-seq abstract-declarator[opt] '=' assignment-expression
+///   decl-specifier-seq declarator attributes[opt]
+///   decl-specifier-seq declarator attributes[opt] '=' assignment-expression
+///   decl-specifier-seq abstract-declarator[opt] attributes[opt]
+///   decl-specifier-seq abstract-declarator[opt] attributes[opt]
+///     '=' assignment-expression
 ///
 Parser::TPResult Parser::TryParseParameterDeclarationClause() {
 
@@ -1047,6 +1048,10 @@
     if (TPR != TPResult::Ambiguous())
       return TPR;
 
+    // [GNU] attributes[opt]
+    if (Tok.is(tok::kw___attribute))
+      return TPResult::True();
+
     if (Tok.is(tok::equal)) {
       // '=' assignment-expression
       // Parse through assignment-expression.

Modified: cfe/branches/Apple/whitney/test/SemaCXX/dcl_ambig_res.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/SemaCXX/dcl_ambig_res.cpp?rev=121556&r1=121555&r2=121556&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/test/SemaCXX/dcl_ambig_res.cpp (original)
+++ cfe/branches/Apple/whitney/test/SemaCXX/dcl_ambig_res.cpp Fri Dec 10 15:37:56 2010
@@ -71,3 +71,6 @@
 int foo8() {
   int v(int(S5::value)); // expected-warning{{disambiguated}} expected-error{{parameter declarator cannot be qualified}}
 }
+
+template<typename T>
+void rdar8739801( void (T::*)( void ) __attribute__((unused)) );





More information about the llvm-branch-commits mailing list