aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2021-07-07 20:02:18 -0400
committerMarek Polacek <polacek@redhat.com>2021-07-08 17:38:49 -0400
commitdee00bf6894be0cabb8f263c993357a6f8444f8b (patch)
tree28900c25657b1c8193f3d6491c7b58a5c57806b2 /gcc/tree-ssa-phiopt.c
parentb14ac7b29c9a05c94f62fe065c219bbaa83653db (diff)
downloadgcc-dee00bf6894be0cabb8f263c993357a6f8444f8b.zip
gcc-dee00bf6894be0cabb8f263c993357a6f8444f8b.tar.gz
gcc-dee00bf6894be0cabb8f263c993357a6f8444f8b.tar.bz2
c++: Fix noexcept with unevaluated operand [PR101087]
It sounds plausible that this assert int f(); static_assert(noexcept(sizeof(f()))); should pass: sizeof produces a std::size_t and its operand is not evaluated, so it can't throw. noexcept should only evaluate to false for potentially evaluated operands. Therefore I think that check_noexcept_r shouldn't walk into operands of sizeof/decltype/ alignof/typeof. PR c++/101087 gcc/cp/ChangeLog: * cp-tree.h (unevaluated_p): New. * except.c (check_noexcept_r): Use it. Don't walk into unevaluated operands. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/noexcept70.C: New test.
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
0 files changed, 0 insertions, 0 deletions