diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-07 10:21:57 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-07 10:21:57 +0000 |
commit | 3f2a8a0de575b02408384f92914729b7518d4e77 (patch) | |
tree | fc4553aeec4cbc1ca9f8dea5807a6f13723ccc81 /lib/Parse/ParseDecl.cpp | |
parent | bb316c5b561a2d8a31ead6800e05ca923a255cb8 (diff) |
In ParseParenDeclarator match "D.setGroupingParens(true);" with another setGroupingParens call after the ')' is parsed.
Fixes this bug:
int (x)(0); // error, expected function declarator where the '(0)' initializer is
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 7d1a9bb4b6..c541a1336f 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1279,6 +1279,7 @@ void Parser::ParseParenDeclarator(Declarator &D) { // direct-declarator: '(' declarator ')' // direct-declarator: '(' attributes declarator ')' if (isGrouping) { + bool hadGroupingParens = D.hasGroupingParens(); D.setGroupingParens(true); if (Tok.is(tok::kw___attribute)) @@ -1287,6 +1288,8 @@ void Parser::ParseParenDeclarator(Declarator &D) { ParseDeclaratorInternal(D); // Match the ')'. MatchRHSPunctuation(tok::r_paren, StartLoc); + + D.setGroupingParens(hadGroupingParens); return; } |