Move policy on unnamed fields (a Microsoft extension) from Parser::ParseStructDeclaration() to the driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46974 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 8b3c2f9..2f47e51 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -440,6 +440,9 @@
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);
}
//===----------------------------------------------------------------------===//
diff --git a/Parse/ParseDecl.cpp b/Parse/ParseDecl.cpp
index 454a05d..ea12a7c 100644
--- a/Parse/ParseDecl.cpp
+++ b/Parse/ParseDecl.cpp
@@ -671,8 +671,7 @@
// 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;
}