[PATCH] D48296: clang-cl: Emit normal narrowing diagnostics for initializer lists if -fmsc-version is at least 1900 (i.e. MSVC2015).

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 18 14:09:31 PDT 2018


rnk added a comment.

Do you think we should go ahead and remove the `DefaultIgnore` on these warnings as well? At this point, approximately nobody will see them.



================
Comment at: clang/lib/Sema/SemaInit.cpp:8367-8370
+    bool DiagErr =
+        S.getLangOpts().CPlusPlus11 &&
+        (!S.getLangOpts().MicrosoftExt ||
+         S.getLangOpts().isCompatibleWithMSVC(LangOptions::MSVC2015));
----------------
Can you hoist this out of the switch or put it in a helper, maybe with a name like [Ii]sNarrowingAnError


================
Comment at: clang/lib/Sema/SemaInit.cpp:8377
+        << EntityType.getLocalUnqualifiedType();
+  } break;
+
----------------
I'd put the break inside the brace if you still need it after this.


https://reviews.llvm.org/D48296





More information about the cfe-commits mailing list