diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-05-16 23:40:44 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-05-16 23:40:44 +0000 |
commit | bc6c848f3e0ec2dc44f6e3d59ef85e884cc9b7be (patch) | |
tree | 8e77a4fa43b0fdcc4954cb51c62cb0d0768836c9 /lib/Parse/ParseExpr.cpp | |
parent | 3f7a5310d43ea58c07d06965b46718a8012b1f76 (diff) |
Make the RAII extension warning silencing for __extension__ a bit
narrower, so it doesn't catch expresions that aren't sub-expressions of
__extension__ operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 20c55a1ea3..55fc0cdd6c 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -225,8 +225,14 @@ Parser::ParseExpressionWithLeadingAt(SourceLocation AtLoc) { /// process of disambiguating between an expression and a declaration. Parser::OwningExprResult Parser::ParseExpressionWithLeadingExtension(SourceLocation ExtLoc) { - OwningExprResult LHS(ParseCastExpression(false)); - if (LHS.isInvalid()) return move(LHS); + OwningExprResult LHS(Actions, true); + { + // Silence extension warnings in the sub-expression + ExtensionRAIIObject O(Diags); + + LHS = ParseCastExpression(false); + if (LHS.isInvalid()) return move(LHS); + } LHS = Actions.ActOnUnaryOp(CurScope, ExtLoc, tok::kw___extension__, move(LHS)); |