diff options
author | Marek Polacek <polacek@redhat.com> | 2024-01-31 17:33:26 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2024-02-01 09:00:29 -0500 |
commit | 65b105b4f399559685200e1598ead8c7d0935c04 (patch) | |
tree | bbc094289fa1a02d7c0d0ddc723333c295327e97 /libcpp | |
parent | ec217f7282cd4284cecda1c65a1e04323e6c8354 (diff) | |
download | gcc-65b105b4f399559685200e1598ead8c7d0935c04.zip gcc-65b105b4f399559685200e1598ead8c7d0935c04.tar.gz gcc-65b105b4f399559685200e1598ead8c7d0935c04.tar.bz2 |
c++: ICE with throw inside concept [PR112437]
We crash in the loop at the end of treat_lvalue_as_rvalue_p for code
like
template <class T>
concept Throwable = requires(T x) { throw x; };
because the code assumes that we eventually reach sk_function_parms or
sk_try and bail, but in a concept we're in a sk_namespace.
We're already checking sk_try so we don't crash in a function-try-block,
but I've added a test anyway.
PR c++/112437
gcc/cp/ChangeLog:
* typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespace in
the move on throw of parms loop.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-throw1.C: New test.
* g++.dg/eh/throw4.C: New test.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions