[libc++][test] Mark throw_format_error as noreturn.
authorMark de Wever <koraq@xs4all.nl>
Thu, 25 May 2023 17:45:50 +0000 (19:45 +0200)
committerMark de Wever <koraq@xs4all.nl>
Thu, 25 May 2023 17:45:50 +0000 (19:45 +0200)
This fixes and GCC error. This was tested in D135787.

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

index e5f6bbb..e979a20 100644 (file)
@@ -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
   }