Commit 71b735a5 by Jason Merrill Committed by Jason Merrill

re PR c++/59347 (ICE on invalid: tree check: expected class 'type', have…

re PR c++/59347 (ICE on invalid: tree check: expected class 'type', have 'exceptional' (error_mark) in tsubst_decl, at cp/pt.c:10798)

	PR c++/59347
	* pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
	erroneous typedef.

From-SVN: r208025
parent 2671a8ef
2014-02-21 Jason Merrill <jason@redhat.com> 2014-02-21 Jason Merrill <jason@redhat.com>
PR c++/59347
* pt.c (tsubst_decl) [TYPE_DECL]: Don't try to instantiate an
erroneous typedef.
PR c++/60241 PR c++/60241
* pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS * pt.c (lookup_template_class_1): Update DECL_TEMPLATE_INSTANTIATIONS
of the partial instantiation, not the most general template. of the partial instantiation, not the most general template.
......
...@@ -10824,6 +10824,9 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) ...@@ -10824,6 +10824,9 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
tree type = NULL_TREE; tree type = NULL_TREE;
bool local_p; bool local_p;
if (TREE_TYPE (t) == error_mark_node)
RETURN (error_mark_node);
if (TREE_CODE (t) == TYPE_DECL if (TREE_CODE (t) == TYPE_DECL
&& t == TYPE_MAIN_DECL (TREE_TYPE (t))) && t == TYPE_MAIN_DECL (TREE_TYPE (t)))
{ {
......
// PR c++/59347
template<int> struct A
{
typedef int ::X; // { dg-error "" }
};
A<0> a;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment