From: Volker Reichelt Date: Sat, 29 Apr 2006 20:48:45 +0000 (+0000) Subject: re PR c++/27279 (ICE with invalid constructor declaration) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=139a78c724ec43eca674ae5457a60cf0b43076ca;p=gcc.git re PR c++/27279 (ICE with invalid constructor declaration) PR c++/27279 * decl.c (copy_fn_p): Skip functions with invalid first arg. * g++.dg/parse/ctor4.C: New test. From-SVN: r113378 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 17e3b291c21..c93e39f5691 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2006-04-29 Volker Reichelt + + PR c++/27279 + * decl.c (copy_fn_p): Skip functions with invalid first arg. + 2006-04-27 Mark Mitchell PR c++/27292 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index c7967c7709b..1617a47bbfc 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8829,6 +8829,8 @@ copy_fn_p (tree d) return 0; arg_type = TREE_VALUE (args); + if (arg_type == error_mark_node) + return 0; if (TYPE_MAIN_VARIANT (arg_type) == DECL_CONTEXT (d)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7bd203ef2b5..1a5d0ab8615 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-04-29 Volker Reichelt + + PR c++/27279 + * g++.dg/parse/ctor4.C: New test. + 2006-04-29 Francois-Xavier Coudert PR fortran/25681 diff --git a/gcc/testsuite/g++.dg/parse/ctor4.C b/gcc/testsuite/g++.dg/parse/ctor4.C new file mode 100644 index 00000000000..a3e4868e0d8 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/ctor4.C @@ -0,0 +1,7 @@ +// PR c++/27279 +// { dg-do compile } + +struct A +{ + A(void,void); // { dg-error "incomplete type|invalid use" } +};