summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.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
commitf02ef3e6d4a3367f0473f3d81bb3080f51be7488 (patch)
treeb33617d23055c8620c14f5b5885c3f223423663f /clang/lib/Parse/ParseDecl.cpp
parent93429b047b3a64a4c608dd5d85df357e3dbe90f8 (diff)
downloadbcm5719-llvm-f02ef3e6d4a3367f0473f3d81bb3080f51be7488.tar.gz
bcm5719-llvm-f02ef3e6d4a3367f0473f3d81bb3080f51be7488.zip
implement a couple fixme's by implementing __extension__ properly.
llvm-svn: 57806
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 041d876f567..27133d683c9 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -15,6 +15,7 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Parse/DeclSpec.h"
#include "clang/Parse/Scope.h"
+#include "ExtensionRAIIObject.h"
#include "llvm/ADT/SmallSet.h"
using namespace clang;
@@ -659,15 +660,16 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) {
void Parser::
ParseStructDeclaration(DeclSpec &DS,
llvm::SmallVectorImpl<FieldDeclarator> &Fields) {
- // FIXME: When __extension__ is specified, disable extension diagnostics.
- while (Tok.is(tok::kw___extension__))
+ if (Tok.is(tok::kw___extension__)) {
+ // __extension__ silences extension warnings in the subexpression.
+ ExtensionRAIIObject O(Diags); // Use RAII to do this.
ConsumeToken();
+ return ParseStructDeclaration(DS, Fields);
+ }
// Parse the common specifier-qualifiers-list piece.
SourceLocation DSStart = Tok.getLocation();
ParseSpecifierQualifierList(DS);
- // TODO: Does specifier-qualifier list correctly check that *something* is
- // specified?
// If there are no declarators, issue a warning.
if (Tok.is(tok::semi)) {
OpenPOWER on IntegriCloud