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 | 051d8fd809d88ae9d62dbf6123ec72e58005ce3e (patch) | |
| tree | 504b047a04ee36fce32493c8e695c6120a7b5110 /clang/lib | |
| parent | 5f40dec258a5d69483fe7f797467087009f2394b (diff) | |
| download | bcm5719-llvm-051d8fd809d88ae9d62dbf6123ec72e58005ce3e.tar.gz bcm5719-llvm-051d8fd809d88ae9d62dbf6123ec72e58005ce3e.zip | |
Warn about typedefs of enums without any declarator name. Fixes rdar://problem/6503878
llvm-svn: 62397
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 73465262659..82c8ea099d1 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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; } |

