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
This commit is contained in:
parent
0a5c6d78b7
commit
427d369ce1
@ -1,3 +1,9 @@
|
||||
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;
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
11
gcc/testsuite/g++.dg/other/default13.C
Normal file
11
gcc/testsuite/g++.dg/other/default13.C
Normal file
@ -0,0 +1,11 @@
|
||||
// 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);
|
Loading…
Reference in New Issue
Block a user