]> granicus.if.org Git - clang/commitdiff
Suppress the "typedef requires a name" warning in Microsoft-extensions mode
authorDouglas Gregor <dgregor@apple.com>
Fri, 16 Jul 2010 15:18:19 +0000 (15:18 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 16 Jul 2010 15:18:19 +0000 (15:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108526 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/Parser/MicrosoftExtensions.c

index 29ecdbc680a240f94a2051f8ec1cab7884062692..12c60d2e9019f2cb42b40119ad7978a759b4622a 100644 (file)
@@ -1553,8 +1553,9 @@ Sema::DeclPtrTy Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
     // 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);
     }
 
index 0b2733e6946194b8b3c33621af796ca026b7381d..4a52e8b636402f01328d9e784e424a02cbfa5e0a 100644 (file)
@@ -34,3 +34,4 @@ typedef bool (__stdcall __stdcall *blarg)(int);
 #define FOO(x) #@x
 char x = FOO(a);
 
+typedef enum E { e1 };