diff options
author | Patrick Palka <ppalka@redhat.com> | 2020-03-13 14:30:39 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2020-03-23 16:08:43 -0400 |
commit | 1f6c1c82eb5001a844b5ac535f6aba4a3257031f (patch) | |
tree | da497ce06d4a5d8684da11fe5456b78a14e5f1a8 /gcc/tree-ssa-loop-manip.c | |
parent | ca6c722561ce9b9dc7b59cfd9d29c9b466732721 (diff) | |
download | gcc-1f6c1c82eb5001a844b5ac535f6aba4a3257031f.zip gcc-1f6c1c82eb5001a844b5ac535f6aba4a3257031f.tar.gz gcc-1f6c1c82eb5001a844b5ac535f6aba4a3257031f.tar.bz2 |
c++: Avoid a suspicious -Wnoexcept warning [PR93805]
In this PR we're emitting -Wnoexcept warnings about potentially-throwing NSDMIs
when computing the noexcept specification of a class's defaulted default
constructor. Although these warnings are in some sense valid, this patch takes
the route of suppressing them, because:
1. the warning message is confusing in its current form;
2. warning for 'struct C { B b = B(); };' but not for 'struct C { B b; };'
is inconsistent; and
3. emitting a warning here arguably doesn't fall under the umbrella of
-Wnoexcept, whose documentation says it warns only when a
noexcept-expression evaluates to false, but there are no
noexcept-expressions here.
gcc/cp/ChangeLog:
PR c++/93805
* except.c (maybe_noexcept_warning): Add TODO comment.
* method.c (walk_field_subobs): Pass tf_none to expr_noexcept_p.
gcc/testsuite/ChangeLog:
PR c++/93805
* g++.dg/warn/Wnoexcept2.C: New test.
Diffstat (limited to 'gcc/tree-ssa-loop-manip.c')
0 files changed, 0 insertions, 0 deletions