]> granicus.if.org Git - clang/commitdiff
EXTWARNify the warning about unnamed typedefs of enums
authorDouglas Gregor <dgregor@apple.com>
Thu, 22 Jan 2009 16:23:54 +0000 (16:23 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 22 Jan 2009 16:23:54 +0000 (16:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62766 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticKinds.def
lib/Sema/SemaDecl.cpp

index 664d3af3653918b1f287659fc8ba3e22e3020d13..259265c2bfc83313396313f54b6b04f7d5e44a22 100644 (file)
@@ -606,7 +606,7 @@ DIAG(err_expected_unqualified_id, ERROR,
      "expected unqualified-id")
 DIAG(err_no_declarators, ERROR,
      "declaration does not declare anything")
-DIAG(warn_no_declarators, WARNING,
+DIAG(ext_typedef_without_a_name, EXTWARN,
      "typedef requires a name")
 DIAG(err_func_def_no_params, ERROR,
      "function definition does not declare parameters")
index dbf1e7b41659ab638d369897db88824842a8089e..276f2e24e85dd782c281c0d58fec34824f6415e9 100644 (file)
@@ -736,11 +736,12 @@ Sema::DeclTy *Sema::ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
       return Tag;
   }
 
-  // Permit typedefs without declarators as a Microsoft extension.
   if (!DS.isMissingDeclaratorOk()) {
+    // Warn about typedefs of enums without names, since this is an
+    // extension in both Microsoft an GNU.
     if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef &&
         Tag && isa<EnumDecl>(Tag)) {
-      Diag(DS.getSourceRange().getBegin(), diag::warn_no_declarators)
+      Diag(DS.getSourceRange().getBegin(), diag::ext_typedef_without_a_name)
         << DS.getSourceRange();
       return Tag;
     }