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

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 18 13:25:41 PDT 2018


thakis created this revision.
thakis added a reviewer: rnk.

Diagnostics for narrowing conversions in initializer lists are currently DefaultIgnored in Microsoft mode. But MSVC 2015 did add warnings about narrowing conversions (C2397), so clang-cl can remove its special case code if MSCompatibilityVersion is new enough.

(In MSVC, C2397 is just a warning and in clang it's default-mapped to an error, but it can be remapped, and disabled with -Wno-c++11-narrowing, so that should be fine.)

Fixes PR37314.


https://reviews.llvm.org/D48296

Files:
  clang/lib/Sema/SemaInit.cpp
  clang/test/SemaCXX/ms-initlist-narrowing.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48296.151781.patch
Type: text/x-patch
Size: 4261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180618/74a54f67/attachment.bin>


More information about the cfe-commits mailing list