diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-12-08 02:02:46 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-12-08 02:02:46 +0000 |
commit | 346af03b21db01264852afb8a86719c9284855fe (patch) | |
tree | c15c0673222009b121feecd888165d4c215ff16b /lib/Parse/ParseTentative.cpp | |
parent | 9d8231afec576559a73b352678b30452e1e83232 (diff) |
Handle parameter attributes when tentative parsing for function/variable disambiguation.
Fixes rdar://8739801.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseTentative.cpp')
-rw-r--r-- | lib/Parse/ParseTentative.cpp | 13 |
1 files changed, 9 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. |