From: Dodji Seketeli Date: Thu, 15 Jan 2009 13:01:36 +0000 (+0000) Subject: re PR c++/38636 (ICE with broken ctor declaration) X-Git-Tag: releases/gcc-4.4.0~861 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0efc44420bbbcdabc7b0606102f474ae3cea4cf1;p=thirdparty%2Fgcc.git re PR c++/38636 (ICE with broken ctor declaration) gcc/cp/ChangeLog: 2009-01-13 Dodji Seketeli PR c++/38636 * name-lookup.c (pushtag): Don't create members to types that are not being created. gcc/testsuite/ChangeLog: 2009-01-13 Dodji Seketeli PR c++/38636 * g++.dg/parse/crash50.C: New test. From-SVN: r143392 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index da52022eea1c..07b9c7e49e6d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-01-15 Dodji Seketeli + + PR c++/38636 + * name-lookup.c (pushtag): Don't create members to types that are not + being created. + 2009-01-14 Nick Clifton PR c++/37862 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 6dc244fccb8b..f8d0204f0994 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -5109,6 +5109,9 @@ pushtag (tree name, tree type, tag_scope scope) if (b->kind == sk_class) { + if (!TYPE_BEING_DEFINED (current_class_type)) + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node); + if (!PROCESSING_REAL_TEMPLATE_DECL_P ()) /* Put this TYPE_DECL on the TYPE_FIELDS list for the class. But if it's a member template class, we want diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fae2df8f3f6d..237ce656c31c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-01-15 Dodji Seketeli + + PR c++/38636 + * g++.dg/parse/crash50.C: New test. + 2009-01-14 Jakub Jelinek PR rtl-optimization/38245 diff --git a/gcc/testsuite/g++.dg/parse/crash50.C b/gcc/testsuite/g++.dg/parse/crash50.C new file mode 100644 index 000000000000..711048de1607 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/crash50.C @@ -0,0 +1,10 @@ +// Contributed by Dodji Seketeli +// Origin PR c++/38636 +// { dg-do compile } + +struct A; // { dg-error "forward declaration of 'struct A'" } + +A::A( + +struct B; // { dg-error "expected '\\)' before ';' token|invalid use of incomplete type 'struct A'" } +