[cfe-commits] r46974 - in /cfe/trunk: Driver/clang.cpp Parse/ParseDecl.cpp
Steve Naroff
snaroff at apple.com
Mon Feb 11 14:40:11 PST 2008
Author: snaroff
Date: Mon Feb 11 16:40:08 2008
New Revision: 46974
URL: http://llvm.org/viewvc/llvm-project?rev=46974&view=rev
Log:
Move policy on unnamed fields (a Microsoft extension) from Parser::ParseStructDeclaration() to the driver.
Modified:
cfe/trunk/Driver/clang.cpp
cfe/trunk/Parse/ParseDecl.cpp
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=46974&r1=46973&r2=46974&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Mon Feb 11 16:40:08 2008
@@ -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);
}
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseDecl.cpp?rev=46974&r1=46973&r2=46974&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/Parse/ParseDecl.cpp Mon Feb 11 16:40:08 2008
@@ -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;
}
More information about the cfe-commits
mailing list