diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-06-17 10:52:18 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-06-17 10:52:18 +0000 |
commit | 36d36806f1972f7ec1d2a3f59155187278c56508 (patch) | |
tree | 192bc210f97918d96aa56b1f9e3bd8bc273dfe8f /lib/Parse/ParseDecl.cpp | |
parent | 2574f6f35a54c1c1b5bcef1e69417fe58f566c11 (diff) |
Make sure parens/braces/brackets are correctly balanced.
In a line like:
(;
the semicolon leaves Parser:ParenCount unbalanced (it's 1 even though we stopped looking for a right paren).
This may affect later parsing and result in bad recovery for parsing errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106213 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 65c42193f6..ad1a690b42 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -309,6 +309,8 @@ AttributeList* Parser::ParseMicrosoftTypeAttributes(AttributeList *CurrAttr) { Parser::DeclGroupPtrTy Parser::ParseDeclaration(unsigned Context, SourceLocation &DeclEnd, CXX0XAttributeList Attr) { + ParenBraceBracketBalancer BalancerRAIIObj(*this); + DeclPtrTy SingleDecl; switch (Tok.getKind()) { case tok::kw_template: |