]> granicus.if.org Git - clang/commitdiff
CFieldCallback doesn't need to create an ExtensionRAIIObject: it's actually
authorJohn McCall <rjmccall@apple.com>
Tue, 3 Nov 2009 21:13:47 +0000 (21:13 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 3 Nov 2009 21:13:47 +0000 (21:13 +0000)
automatically shadowed by the ExtensionRAIIObject created by
ParseStructDeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85941 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDecl.cpp

index be0df330671425f5658526eb5846a028c1d0e994..a47065c2b54fa8ed77263dc1d3b926a46d9f4ae9 100644 (file)
@@ -1605,21 +1605,10 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
           P(P), TagDecl(TagDecl), FieldDecls(FieldDecls) {}
 
         virtual DeclPtrTy invoke(FieldDeclarator &FD) {
-          const DeclSpec &DS = FD.D.getDeclSpec();
-          DeclPtrTy Field;
-
           // Install the declarator into the current TagDecl.
-          if (FD.D.getExtension()) {
-            // Silences extension warnings
-            ExtensionRAIIObject O(P.Diags);
-            Field = P.Actions.ActOnField(P.CurScope, TagDecl,
-                                         DS.getSourceRange().getBegin(),
-                                         FD.D, FD.BitfieldSize);
-          } else {
-            Field = P.Actions.ActOnField(P.CurScope, TagDecl,
-                                         DS.getSourceRange().getBegin(),
-                                         FD.D, FD.BitfieldSize);
-          }
+          DeclPtrTy Field = P.Actions.ActOnField(P.CurScope, TagDecl,
+                              FD.D.getDeclSpec().getSourceRange().getBegin(),
+                                                 FD.D, FD.BitfieldSize);
           FieldDecls.push_back(Field);
           return Field;
         }