[PATCH] D45594: [libcxx] [test] Silence MSVC warning C4146.

Stephan T. Lavavej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 12 15:15:39 PDT 2018


STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.

[libcxx] [test] Silence MSVC warning C4146.

This test code triggers the MSVC warning:

"unary minus operator applied to unsigned type, result still unsigned"

Although it would be possible to change the test code to avoid
this warning, I have chosen to simply silence it.


https://reviews.llvm.org/D45594

Files:
  test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp


Index: test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
===================================================================
--- test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
+++ test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
@@ -22,6 +22,10 @@
 #include <iostream>
 #include "test_iterators.h"
 
+#ifdef _MSC_VER
+#pragma warning(disable: 4146) // unary minus operator applied to unsigned type, result still unsigned
+#endif
+
 typedef std::num_get<char, input_iterator<const char*> > F;
 
 class my_facet


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45594.142271.patch
Type: text/x-patch
Size: 712 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180412/460dba38/attachment.bin>


More information about the cfe-commits mailing list