[libcxx] r329975 - [libcxx] [test] Fix nodiscard warnings.

Stephan T. Lavavej via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 12 16:56:12 PDT 2018


Author: stl_msft
Date: Thu Apr 12 16:56:12 2018
New Revision: 329975

URL: http://llvm.org/viewvc/llvm-project?rev=329975&view=rev
Log:
[libcxx] [test] Fix nodiscard warnings.

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

Fixes D45595.

Modified:
    libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp

Modified: libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp?rev=329975&r1=329974&r2=329975&view=diff
==============================================================================
--- libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp (original)
+++ libcxx/trunk/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp Thu Apr 12 16:56:12 2018
@@ -33,7 +33,7 @@ int main()
         Myconv myconv;
         try
         {
-            myconv.to_bytes(L"\xDA83");
+            (void)myconv.to_bytes(L"\xDA83");
             assert(false);
         }
         catch (const std::range_error&)
@@ -41,7 +41,7 @@ int main()
         }
         try
         {
-            myconv.from_bytes('\xA5');
+            (void)myconv.from_bytes('\xA5');
             assert(false);
         }
         catch (const std::range_error&)
@@ -56,7 +56,7 @@ int main()
 #ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
-            myconv.from_bytes('\xA5');
+            (void)myconv.from_bytes('\xA5');
             assert(false);
         }
         catch (const std::range_error&)




More information about the cfe-commits mailing list