diff options
author | Chris Lattner <sabre@nondot.org> | 2008-10-20 06:45:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-10-20 06:45:43 +0000 |
commit | c46d1a1f8af67a87689d7db9eaf96027282ccaea (patch) | |
tree | e5a1cf61f756b78e1107f53230d9cb8b0e58175b /lib/Parse/ParseDecl.cpp | |
parent | da3253d8a97981257185c89ced71ce137278b121 (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/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 041d876f56..27133d683c 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::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)) { |