mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
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 <tkaminsk@redhat.com>
This commit is contained in:
committed by
Jonathan Wakely
parent
9765a73075
commit
1be41ad752
@@ -3,8 +3,8 @@
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#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 {
|
||||
|
||||
@@ -33,6 +33,8 @@ struct iter
|
||||
};
|
||||
|
||||
using CS = std::csub_match;
|
||||
static_assert( noexcept(std::declval<CS&>().swap(std::declval<CS&>())) );
|
||||
static_assert( noexcept(std::declval<CS&>().swap(std::declval<CS&>())),
|
||||
"std::csub_match::swap is nothrow" );
|
||||
using IS = std::sub_match<iter>;
|
||||
static_assert( ! noexcept(std::declval<IS&>().swap(std::declval<IS&>())) );
|
||||
static_assert( ! noexcept(std::declval<IS&>().swap(std::declval<IS&>())),
|
||||
"std::sub_match<I>::swap is potentially throwing" );
|
||||
|
||||
Reference in New Issue
Block a user