aboutsummaryrefslogtreecommitdiff
path: root/libiberty/regex.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2024-09-06 15:28:53 -0400
committerJason Merrill <jason@redhat.com>2024-09-07 18:54:13 -0400
commit7cebc6384a0ad63d444029472a8ed1afe965bbbc (patch)
treeb409b60ed2ec77c5484dc1b6471266cbbac3ec8f /libiberty/regex.c
parent69d82c1dccb3583464228eb5449e29918eeb4ee4 (diff)
downloadgcc-7cebc6384a0ad63d444029472a8ed1afe965bbbc.zip
gcc-7cebc6384a0ad63d444029472a8ed1afe965bbbc.tar.gz
gcc-7cebc6384a0ad63d444029472a8ed1afe965bbbc.tar.bz2
c++: exception spec and stdlib specialization
We were silently accepting the pr65923.C specialization of std::swap with the wrong exception specification; it should be declared noexcept. Let's limit ignoring mismatch with system headers to extern "C" functions so we get a diagnostic for the C++ library. In the case of an omitted exception-specification, let's also lower the error to a pedwarn, and copy the missing spec over, to avoid a hard break for code that accidentally relied on the old behavior. ...except extern "C" functions keep the new spec, to avoid breaking dubious code like noexcept-type19.C. gcc/cp/ChangeLog: * decl.cc (check_redeclaration_exception_specification): Remove OPT_Wsystem_headers from pedwarn when the old declaration is in a system header. Also check std namespace. gcc/testsuite/ChangeLog: * g++.dg/diagnostic/pr65923.C: Add noexcept. * g++.dg/cpp1z/aligned-new3.C: Expect pedwarn. * g++.dg/cpp1z/noexcept-type19.C: Add comment.
Diffstat (limited to 'libiberty/regex.c')
0 files changed, 0 insertions, 0 deletions