diff options
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 5 | ||||
-rw-r--r-- | test/Parser/MicrosoftExtensions.c | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 29ecdbc680..12c60d2e90 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -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); } diff --git a/test/Parser/MicrosoftExtensions.c b/test/Parser/MicrosoftExtensions.c index 0b2733e694..4a52e8b636 100644 --- a/test/Parser/MicrosoftExtensions.c +++ b/test/Parser/MicrosoftExtensions.c @@ -34,3 +34,4 @@ typedef bool (__stdcall __stdcall *blarg)(int); #define FOO(x) #@x char x = FOO(a); +typedef enum E { e1 }; |