From: Jonathan Wakely Date: Mon, 2 Feb 2026 13:10:50 +0000 (+0000) Subject: libstdc++: Fix some -Wpedantic warnings in regex tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1be41ad752945b0ed5c26aa134a30c145a29afd0;p=thirdparty%2Fgcc.git libstdc++: Fix some -Wpedantic warnings in regex tests These tests can be run as C++11, so should use a string literal with the static assertions. libstdc++-v3/ChangeLog: * testsuite/28_regex/algorithms/regex_match/multiline.cc: Add string to static_assert. * testsuite/28_regex/sub_match/lwg3204.cc: Likewise. Reviewed-by: Tomasz KamiƄski --- diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc index f4b3cf03a22..090fd0955cc 100644 --- a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc +++ b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/multiline.cc @@ -3,8 +3,8 @@ #include #if __cplusplus >= 201703L || !defined __STRICT_ANSI__ -static_assert( std::regex_constants::multiline == std::regex::multiline ); -static_assert( std::regex_constants::__multiline == std::regex::multiline ); +static_assert( std::regex_constants::multiline == std::regex::multiline, "" ); +static_assert( std::regex_constants::__multiline == std::regex::multiline, "" ); #else namespace test { constexpr int multiline = 0; } namespace check { diff --git a/libstdc++-v3/testsuite/28_regex/sub_match/lwg3204.cc b/libstdc++-v3/testsuite/28_regex/sub_match/lwg3204.cc index 58ef0df58a1..d95aed36787 100644 --- a/libstdc++-v3/testsuite/28_regex/sub_match/lwg3204.cc +++ b/libstdc++-v3/testsuite/28_regex/sub_match/lwg3204.cc @@ -33,6 +33,8 @@ struct iter }; using CS = std::csub_match; -static_assert( noexcept(std::declval().swap(std::declval())) ); +static_assert( noexcept(std::declval().swap(std::declval())), + "std::csub_match::swap is nothrow" ); using IS = std::sub_match; -static_assert( ! noexcept(std::declval().swap(std::declval())) ); +static_assert( ! noexcept(std::declval().swap(std::declval())), + "std::sub_match::swap is potentially throwing" );