diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-01-17 02:55:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-01-17 02:55:50 +0000 |
commit | 8158f692571ba5eaae19e086b76d19319ac503c5 (patch) | |
tree | 7ab66b15337277806041214102bface5293af650 /lib/Sema/SemaDecl.cpp | |
parent | 7d791fd22efd3649f23616ba00b9e98076c27ad4 (diff) |
Warn about typedefs of enums without any declarator name. Fixes rdar://problem/6503878
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 7346526265..82c8ea099d 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -741,9 +741,9 @@ Sema::DeclTy *Sema::ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) { // Permit typedefs without declarators as a Microsoft extension. if (!DS.isMissingDeclaratorOk()) { - if (getLangOptions().Microsoft && - DS.getStorageClassSpec() == DeclSpec::SCS_typedef) { - Diag(DS.getSourceRange().getBegin(), diag::ext_no_declarators) + if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef && + Tag && isa<EnumDecl>(Tag)) { + Diag(DS.getSourceRange().getBegin(), diag::warn_no_declarators) << DS.getSourceRange(); return Tag; } |