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

[libcxx] [test] Fix nodiscard warnings.

MSVC's STL has marked to_bytes/from_bytes as nodiscard.


https://reviews.llvm.org/D45595

Files:
  
test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp


Index: 
test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
===================================================================
--- 
test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
+++ 
test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
@@ -33,15 +33,15 @@
         Myconv myconv;
         try
         {
-            myconv.to_bytes(L"\xDA83");
+            (void)myconv.to_bytes(L"\xDA83");
             assert(false);
         }
         catch (const std::range_error&)
         {
         }
         try
         {
-            myconv.from_bytes('\xA5');
+            (void)myconv.from_bytes('\xA5');
             assert(false);
         }
         catch (const std::range_error&)
@@ -56,7 +56,7 @@
 #ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
-            myconv.from_bytes('\xA5');
+            (void)myconv.from_bytes('\xA5');
             assert(false);
         }
         catch (const std::range_error&)


Index: test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
===================================================================
--- test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
+++ test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
@@ -33,15 +33,15 @@
         Myconv myconv;
         try
         {
-            myconv.to_bytes(L"\xDA83");
+            (void)myconv.to_bytes(L"\xDA83");
             assert(false);
         }
         catch (const std::range_error&)
         {
         }
         try
         {
-            myconv.from_bytes('\xA5');
+            (void)myconv.from_bytes('\xA5');
             assert(false);
         }
         catch (const std::range_error&)
@@ -56,7 +56,7 @@
 #ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
-            myconv.from_bytes('\xA5');
+            (void)myconv.from_bytes('\xA5');
             assert(false);
         }
         catch (const std::range_error&)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D45595: [libcxx... Stephan T. Lavavej via Phabricator via cfe-commits

Reply via email to