[libcxx-commits] [libcxx] 32d8c24 - [libc++][test] Mark throw_format_error as noreturn.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 25 10:46:39 PDT 2023


Author: Mark de Wever
Date: 2023-05-25T19:45:50+02:00
New Revision: 32d8c24277129fef82c35cc390c03308808f3596

URL: https://github.com/llvm/llvm-project/commit/32d8c24277129fef82c35cc390c03308808f3596
DIFF: https://github.com/llvm/llvm-project/commit/32d8c24277129fef82c35cc390c03308808f3596.diff

LOG: [libc++][test] Mark throw_format_error as noreturn.

This fixes and GCC error. This was tested in D135787.

Added: 
    

Modified: 
    libcxx/test/support/format.functions.common.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/support/format.functions.common.h b/libcxx/test/support/format.functions.common.h
index e5f6bbbeccda..e979a200b933 100644
--- a/libcxx/test/support/format.functions.common.h
+++ b/libcxx/test/support/format.functions.common.h
@@ -134,11 +134,10 @@ struct std::formatter<status, CharT> {
   }
 
 private:
-  void throw_format_error(const char* s) const {
+  [[noreturn]] void throw_format_error([[maybe_unused]] const char* s) const {
 #ifndef TEST_HAS_NO_EXCEPTIONS
     throw std::format_error(s);
 #else
-    (void)s;
     std::abort();
 #endif
   }


        


More information about the libcxx-commits mailing list