]> granicus.if.org Git - clang/commitdiff
Move policy on unnamed fields (a Microsoft extension) from Parser::ParseStructDeclara...
authorSteve Naroff <snaroff@apple.com>
Mon, 11 Feb 2008 22:40:08 +0000 (22:40 +0000)
committerSteve Naroff <snaroff@apple.com>
Mon, 11 Feb 2008 22:40:08 +0000 (22:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46974 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/clang.cpp
Parse/ParseDecl.cpp

index 8b3c2f9cf003af72bbacbb717f1133972de10add..2f47e5199ca21f5cf0a426892331974c932ebbf9 100644 (file)
@@ -440,6 +440,9 @@ static void InitializeDiagnostics(Diagnostic &Diags) {
                                diag::MAP_IGNORE);
   if (!WarnUndefMacros)
     Diags.setDiagnosticMapping(diag::warn_pp_undef_identifier,diag::MAP_IGNORE);
+    
+  if (MSExtensions) // MS allows unnamed struct/union fields.
+    Diags.setDiagnosticMapping(diag::w_no_declarators, diag::MAP_IGNORE);
 }
 
 //===----------------------------------------------------------------------===//
index 454a05dc448eaf9e667226831604807a75cd583c..ea12a7c120c07c3a6bc0581e0e99fb5005a063fa 100644 (file)
@@ -671,8 +671,7 @@ void Parser::ParseStructDeclaration(DeclTy *TagDecl,
   
   // If there are no declarators, issue a warning.
   if (Tok.is(tok::semi)) {
-    if (!getLang().Microsoft) // MS allows unnamed struct/union fields.
-      Diag(SpecQualLoc, diag::w_no_declarators);
+    Diag(SpecQualLoc, diag::w_no_declarators);
     return;
   }