summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-05-16 23:40:44 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-05-16 23:40:44 +0000
commit15af3ee6a9f145332b29cb5d3d40746df17a5f07 (patch)
tree163497dc4e12d449a3343ac14a60dd76d6bd0a65 /clang/lib/Parse/ParseStmt.cpp
parent678d3bac03704bb8eb200b6eaf2481d8506029cc (diff)
downloadbcm5719-llvm-15af3ee6a9f145332b29cb5d3d40746df17a5f07.tar.gz
bcm5719-llvm-15af3ee6a9f145332b29cb5d3d40746df17a5f07.zip
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. llvm-svn: 71967
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r--clang/lib/Parse/ParseStmt.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index d0d462b66ce..50db966aedb 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -435,13 +435,13 @@ Parser::OwningStmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) {
SourceLocation ExtLoc = ConsumeToken();
while (Tok.is(tok::kw___extension__))
ConsumeToken();
-
- // __extension__ silences extension warnings in the subexpression.
- ExtensionRAIIObject O(Diags); // Use RAII to do this.
// If this is the start of a declaration, parse it as such.
if (isDeclarationStatement()) {
+ // __extension__ silences extension warnings in the subdeclaration.
// FIXME: Save the __extension__ on the decl as a node somehow?
+ ExtensionRAIIObject O(Diags);
+
SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
DeclGroupPtrTy Res = ParseDeclaration(Declarator::BlockContext,DeclEnd);
R = Actions.ActOnDeclStmt(Res, DeclStart, DeclEnd);
OpenPOWER on IntegriCloud