This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
So, when we issue that error, we should do something. One choice would be to replace the second template parameter with error_mark_node. Another would to completely bail out, indicating that the entire template parameter list is erroneous. The point is that we should never get to the point where we're trying to do the problematic substitution; we should have never have a TEMPLATE_DECL for which one of the parameters is an invalid type (other than error_mark_node, perhaps).
The attached patch implements your first suggestion of storing invalid template parameters inside the parameter list list as error_mark_nodes. There was some fallout from this approach in other parts of the compiler as nothing was in place to handle the parameter's being error_mark_node, the handling of which forms the bulk of the patch.
Cheers, Lee.
PR c++27668 * pt.c (process_template_parm): Store invalid template parameters in the parameter list as error_mark_nodes. (push_inline_template_parms_recursive): Handle invalid template parameters indicated by error_mark_node. (check_default_tmpl_args): Likewise. (coerce_template_parms): Likewise. (mangle_class_name_for_template): Likewise. * error.c (dump_template_argument_list): Likewise.
PR c++/27668 * g++.dg/template/crash55.C: New test. * g++.dg/template/void2.C: Adjust error markers. * g++.dg/template/nontype5.C: Likewise.
Attachment:
pr27668.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |