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
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 041d876..27133d6 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/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::
 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)) {