diff options
author | Ben Wu <soggysocks206@gmail.com> | 2025-08-19 13:49:41 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2025-08-19 13:49:50 -0400 |
commit | 54bf72ebfe983c611673bcc4368b5834773fcc7d (patch) | |
tree | 6aece3ea562175fa05c6d01e65b45e9b26a33669 /libjava/gnu/xml/dom/DomText.h | |
parent | 6ece2d7274059265468833fb491db44bd90de72a (diff) | |
download | gcc-54bf72ebfe983c611673bcc4368b5834773fcc7d.zip gcc-54bf72ebfe983c611673bcc4368b5834773fcc7d.tar.gz gcc-54bf72ebfe983c611673bcc4368b5834773fcc7d.tar.bz2 |
c++: Fix ICE on mangling invalid compound requirement [PR120618]
This testcase caused an ICE when mangling the invalid type-constraint in
write_requirement since write_type_constraint expects a TEMPLATE_TYPE_PARM.
Setting the trailing return type to NULL_TREE when a
return-type-requirement is found in place of a type-constraint prevents the
failed assertion in write_requirement. It also allows the invalid
constraint to be satisfied in some contexts to prevent redundant errors,
e.g. in concepts-requires5.C.
Bootstrapped and tested on x86_64-linux-gnu.
PR c++/120618
gcc/cp/ChangeLog:
* parser.cc (cp_parser_compound_requirement): Set type to
NULL_TREE for invalid type-constraint.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-requires5.C: Don't require
redundant diagnostic in static assertion.
* g++.dg/concepts/pr120618.C: New test.
Suggested-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'libjava/gnu/xml/dom/DomText.h')
0 files changed, 0 insertions, 0 deletions