c++: wrong looser excep spec for dep noexcept [PR113158]
commit876fa432ef4074053fa65b1855e7d43320515576
authorMarek Polacek <polacek@redhat.com>
Thu, 15 Feb 2024 22:07:43 +0000 (15 17:07 -0500)
committerMarek Polacek <polacek@redhat.com>
Sat, 17 Feb 2024 14:29:02 +0000 (17 09:29 -0500)
tree6bf53683657a121202f38d5c595100aa881c314a
parent9739d7ebf05aefcdd85477900528d8bee69df215
c++: wrong looser excep spec for dep noexcept [PR113158]

Here we find ourselves in maybe_check_overriding_exception_spec in
a template context where we can't instantiate a dependent noexcept.
That's OK, but we have to defer the checking otherwise we give wrong
errors.

PR c++/113158

gcc/cp/ChangeLog:

* search.cc (maybe_check_overriding_exception_spec): Defer checking
when a noexcept couldn't be instantiated & evaluated to false/true.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/noexcept83.C: New test.
gcc/cp/search.cc
gcc/testsuite/g++.dg/cpp0x/noexcept83.C [new file with mode: 0644]