diff options
-rw-r--r-- | lib/Parse/ParseTentative.cpp | 13 | ||||
-rw-r--r-- | test/SemaCXX/dcl_ambig_res.cpp | 3 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp index 997d01076b..81abdb884a 100644 --- a/lib/Parse/ParseTentative.cpp +++ b/lib/Parse/ParseTentative.cpp @@ -1119,10 +1119,11 @@ bool Parser::isCXXFunctionDeclarator(bool warnIfAmbiguous) { /// 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() { @@ -1157,6 +1158,10 @@ Parser::TPResult Parser::TryParseParameterDeclarationClause() { 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. diff --git a/test/SemaCXX/dcl_ambig_res.cpp b/test/SemaCXX/dcl_ambig_res.cpp index f0ba2978e8..fa71b11ba1 100644 --- a/test/SemaCXX/dcl_ambig_res.cpp +++ b/test/SemaCXX/dcl_ambig_res.cpp @@ -71,3 +71,6 @@ struct S5 { 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)) ); |