[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 1 16:13:45 PDT 2018


nickdesaulniers added inline comments.


================
Comment at: lib/Sema/DeclSpec.cpp:441-442
   else
-    DiagID = IsExtension ? diag::ext_duplicate_declspec :
-                           diag::warn_duplicate_declspec;
+    DiagID = IsExtension ? diag::ext_duplicate_declspec
+                         : diag::extwarn_duplicate_declspec;
   return true;
----------------
rsmith wrote:
> This doesn't look like a correct change. When `IsExtension` is false, the duplicate is not ill-formed, so we shouldn't use an `ExtWarn` diagnostic (which results in an error under `-pedantic-errors`).
If the duplicate is not ill-formed, then isn't the original code incorrect, since it produces a warning?


Repository:
  rC Clang

https://reviews.llvm.org/D52248





More information about the cfe-commits mailing list