diff options
author | Marek Polacek <polacek@redhat.com> | 2024-08-15 18:47:29 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2024-08-19 13:29:30 -0400 |
commit | 53283c3231a7b94e728619cccbf21170fb36b2a8 (patch) | |
tree | 9f00304d88d43edf2d57b55558e2711008272f51 /COPYING3 | |
parent | 8191f15022b0ea44fcb549449b0458d07ae02e0a (diff) | |
download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 |
Here we initialize an enumerator with a class prvalue with a conversion
function. When we fold it in build_enumerator, we create a TARGET_EXPR
for the object, and subsequently crash in tsubst_expr, which should not
see such a code.
Normally, we fix similar problems by using an IMPLICIT_CONV_EXPR but here
I may get away with not using the result of fold_non_dependent_expr unless
the result is a constant. A TARGET_EXPR is not constant.
PR c++/115657
gcc/cp/ChangeLog:
* decl.cc (build_enumerator): Call maybe_fold_non_dependent_expr
instead of fold_non_dependent_expr.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1y/constexpr-recursion2.C: New test.
* g++.dg/template/conv21.C: New test.
Diffstat (limited to 'COPYING3')
0 files changed, 0 insertions, 0 deletions