aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/misc.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2020-11-05 21:46:06 -0500
committerMarek Polacek <polacek@redhat.com>2020-11-06 16:40:54 -0500
commit43d3b7bc073df27800218b685e6d7dd78dd31905 (patch)
treedb1e020925b51515cd9ef0b7a19077aba729d19f /gcc/ada/gcc-interface/misc.c
parent7987a8d29a78eb373b5e054d539e332d75e92e92 (diff)
downloadgcc-43d3b7bc073df27800218b685e6d7dd78dd31905.zip
gcc-43d3b7bc073df27800218b685e6d7dd78dd31905.tar.gz
gcc-43d3b7bc073df27800218b685e6d7dd78dd31905.tar.bz2
c++: Small tweak to can_convert_eh [PR81660]
While messing with check_handlers_1, I spotted this bug report which complains that we don't warn about the case when we have two duplicated handlers of type int. can_convert_eh implements [except.handle] and that says: A handler is a match for an exception object of type E if - The handler is of type cv T or cv T& and E and T are the same type (ignoring the top-level cv-qualifiers), or [...] but we don't implement this bullet properly for non-class types. The fix therefore seems pretty obvious. Also change the return type to bool when we're only returning yes/no. gcc/cp/ChangeLog: PR c++/81660 * except.c (can_convert_eh): Change the return type to bool. If the type TO and FROM are the same, return true. gcc/testsuite/ChangeLog: PR c++/81660 * g++.dg/warn/Wexceptions3.C: New test. * g++.dg/eh/pr42859.C: Add dg-warning. * g++.dg/torture/pr81659.C: Likewise.
Diffstat (limited to 'gcc/ada/gcc-interface/misc.c')
0 files changed, 0 insertions, 0 deletions