diff options
author | Simon Martin <simon@nasilyan.com> | 2024-05-24 17:00:17 +0200 |
---|---|---|
committer | Simon Martin <simon@nasilyan.com> | 2024-06-04 17:10:56 +0200 |
commit | cfbd8735359d84a2d716549415eac70e885167bf (patch) | |
tree | 4cf03d1913472695325181049d433edcf3a1286a /gcc/fold-const.cc | |
parent | 2197814011eec75022aa8550f10621409b69d4a1 (diff) | |
download | gcc-cfbd8735359d84a2d716549415eac70e885167bf.zip gcc-cfbd8735359d84a2d716549415eac70e885167bf.tar.gz gcc-cfbd8735359d84a2d716549415eac70e885167bf.tar.bz2 |
Fix PR c++/111106: missing ; causes internal compiler error
We currently fail upon the following because an assert in dependent_type_p
fails for f's parameter
=== cut here ===
consteval int id (int i) { return i; }
constexpr int
f (auto i) requires requires { id (i) } { return i; }
void g () { f (42); }
=== cut here ===
This patch fixes this by relaxing the assert to pass during error recovery.
Successfully tested on x86_64-pc-linux-gnu.
PR c++/111106
gcc/cp/ChangeLog:
* pt.cc (dependent_type_p): Don't fail assert during error recovery.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/consteval37.C: New test.
Diffstat (limited to 'gcc/fold-const.cc')
0 files changed, 0 insertions, 0 deletions