Commit 427d369c by Paolo Carlini Committed by Paolo Carlini

re PR c++/85028 (ICE on invalid C++ code: in tsubst_default_argument, at cp/pt.c:12340)

/cp
2018-03-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/85028
	* pt.c (tsubst_default_argument): Early return if the type of the
	parameter is erroneous.

/testsuite
2018-03-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/85028
	* g++.dg/other/default13.C: New.

From-SVN: r258932
parent 0a5c6d78
2018-03-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/85028
* pt.c (tsubst_default_argument): Early return if the type of the
parameter is erroneous.
2018-03-28 Alexandre Oliva <aoliva@redhat.com>
PR c++/84973
......
......@@ -12337,6 +12337,9 @@ tsubst_default_argument (tree fn, int parmnum, tree type, tree arg,
tree parmtype = TREE_TYPE (parm);
if (DECL_BY_REFERENCE (parm))
parmtype = TREE_TYPE (parmtype);
if (parmtype == error_mark_node)
return error_mark_node;
gcc_assert (same_type_ignoring_top_level_qualifiers_p (type, parmtype));
tree *slot;
......
2018-03-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/85028
* g++.dg/other/default13.C: New.
2018-03-28 Jakub Jelinek <jakub@redhat.com>
PR target/85095
......
// PR c++/85028
struct A;
template < typename > struct B
{
B (int, A = A()) : f (0) {} // { dg-error "incomplete type" }
int f;
};
B < int > b (0);
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