c++: Fix -Wnoexcept handling of system headers (PR90992).
The immediate issue here was that the second warning didn't depend on the first one, so if the first location was in a system header, we'd mysteriously give the second by itself. It's also the case that the thing we care about being in a system header is the function that we want to suggest adding 'noexcept' to, not the noexcept-expression; it's useful to suggest adding noexcept to a user function to satisfy a noexcept-expression in a system header. PR c++/90992 * except.c (maybe_noexcept_warning): Check DECL_IN_SYSTEM_HEADER and temporarily enable -Wsystem-headers. Change second warning to conditional inform.
Showing
gcc/testsuite/g++.dg/warn/Wnoexcept1.C
0 → 100644
gcc/testsuite/g++.dg/warn/Wnoexcept1.h
0 → 100644
Please
register
or
sign in
to comment