[cfe-commits] r108526 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/Parser/MicrosoftExtensions.c

Douglas Gregor dgregor at apple.com
Fri Jul 16 08:18:19 PDT 2010


Author: dgregor
Date: Fri Jul 16 10:18:19 2010
New Revision: 108526

URL: http://llvm.org/viewvc/llvm-project?rev=108526&view=rev
Log:
Suppress the "typedef requires a name" warning in Microsoft-extensions mode

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/test/Parser/MicrosoftExtensions.c

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=108526&r1=108525&r2=108526&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Jul 16 10:18:19 2010
@@ -1553,8 +1553,9 @@
     // extension in both Microsoft an GNU.
     if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef &&
         Tag && isa<EnumDecl>(Tag)) {
-      Diag(DS.getSourceRange().getBegin(), diag::ext_typedef_without_a_name)
-        << DS.getSourceRange();
+      if (!getLangOptions().Microsoft)
+        Diag(DS.getSourceRange().getBegin(), diag::ext_typedef_without_a_name)
+          << DS.getSourceRange();
       return DeclPtrTy::make(Tag);
     }
 

Modified: cfe/trunk/test/Parser/MicrosoftExtensions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.c?rev=108526&r1=108525&r2=108526&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.c (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.c Fri Jul 16 10:18:19 2010
@@ -34,3 +34,4 @@
 #define FOO(x) #@x
 char x = FOO(a);
 
+typedef enum E { e1 };





More information about the cfe-commits mailing list