aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-10-20 06:45:43 +0000
committerChris Lattner <sabre@nondot.org>2008-10-20 06:45:43 +0000
commitc46d1a1f8af67a87689d7db9eaf96027282ccaea (patch)
treee5a1cf61f756b78e1107f53230d9cb8b0e58175b /lib/Parse/ParseExpr.cpp
parentda3253d8a97981257185c89ced71ce137278b121 (diff)
implement a couple fixme's by implementing __extension__ properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r--lib/Parse/ParseExpr.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index d0f5eb2607..f6d7037ad1 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -22,7 +22,7 @@
#include "clang/Parse/Parser.h"
#include "clang/Parse/DeclSpec.h"
#include "clang/Parse/Scope.h"
-#include "clang/Basic/Diagnostic.h"
+#include "ExtensionRAIIObject.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SmallString.h"
using namespace clang;
@@ -521,13 +521,11 @@ Parser::ExprResult Parser::ParseCastExpression(bool isUnaryExpression) {
case tok::kw___extension__:{//unary-expression:'__extension__' cast-expr [GNU]
// __extension__ silences extension warnings in the subexpression.
- bool SavedExtWarn = Diags.getWarnOnExtensions();
- Diags.setWarnOnExtensions(false);
+ ExtensionRAIIObject O(Diags); // Use RAII to do this.
SourceLocation SavedLoc = ConsumeToken();
Res = ParseCastExpression(false);
if (!Res.isInvalid)
Res = Actions.ActOnUnaryOp(SavedLoc, SavedKind, Res.Val);
- Diags.setWarnOnExtensions(SavedExtWarn);
return Res;
}
case tok::kw_sizeof: // unary-expression: 'sizeof' unary-expression