aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-expr.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-01-04 18:42:31 +0100
committerJakub Jelinek <jakub@redhat.com>2023-01-04 18:42:31 +0100
commitfc349931adcf1024ee95e0a0cd98cf4a41996093 (patch)
tree0f70461ce5caaf86a2fb26e7babe38dd537b4a0d /gcc/rust/resolve/rust-ast-resolve-expr.cc
parentedc038863d88ef0fe7c3ffb3703a9d2b3a17f0a9 (diff)
downloadgcc-fc349931adcf1024ee95e0a0cd98cf4a41996093.zip
gcc-fc349931adcf1024ee95e0a0cd98cf4a41996093.tar.gz
gcc-fc349931adcf1024ee95e0a0cd98cf4a41996093.tar.bz2
c++: Error recovery in merge_default_template_args [PR108206]
We ICE on the following testcase during error recovery, both new_parm and old_parm are error_mark_node, the ICE is on error ("redefinition of default argument for %q+#D", new_parm); inform (DECL_SOURCE_LOCATION (old_parm), "original definition appeared here"); where we don't print anything useful for new_parm and ICE trying to access DECL_SOURCE_LOCATION of old_parm. I think we shouldn't diagnose anything when either of the parms is erroneous, GCC 11 before merge_default_template_args has been added was doing if (TREE_VEC_ELT (tmpl_parms, i) == error_mark_node || TREE_VEC_ELT (parms, i) == error_mark_node) continue; tmpl_parm = TREE_VALUE (TREE_VEC_ELT (tmpl_parms, i)); if (error_operand_p (tmpl_parm)) return false; in redeclare_class_template. 2023-01-04 Jakub Jelinek <jakub@redhat.com> PR c++/108206 * decl.cc (merge_default_template_args): Return false if either new_parm or old_parm are erroneous. * g++.dg/template/pr108206.C: New test.
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-expr.cc')
0 files changed, 0 insertions, 0 deletions