re PR c++/9457 (ICE in tsubst_copy, at cp/pt.c:7124)

PR c++/9457
	* pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Substitute
	CONSTRUCTOR_ELTS only once.

	* g++.dg/template/init1.C: New test.

From-SVN: r63002
This commit is contained in:
Kriang Lerdsuwanakij 2003-02-17 15:42:58 +00:00 committed by Kriang Lerdsuwanakij
parent e6ddcef66a
commit db77ef4c93
4 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2003-02-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9457
* pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Substitute
CONSTRUCTOR_ELTS only once.
2003-02-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9459

View File

@ -8290,8 +8290,7 @@ tsubst_copy_and_build (t, args, complain, in_decl)
initializers as they are identifier nodes which will be
looked up by digest_init. */
purpose_p = !(type && IS_AGGR_TYPE (type));
for (elts = tsubst_copy (CONSTRUCTOR_ELTS (t), args, complain,
in_decl);
for (elts = CONSTRUCTOR_ELTS (t);
elts;
elts = TREE_CHAIN (elts))
{

View File

@ -1,3 +1,8 @@
2003-02-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9457
* g++.dg/template/init1.C: New test.
Sun Feb 16 23:08:19 CET 2003 Jan HUbicka <jh@suse.cz>
* gcc.dg/c90-const-expr-3.c (DZERO): New static variable

View File

@ -0,0 +1,10 @@
// { dg-do compile }
// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
// PR c++/9457: ICE tsubst'ing initializers in templates.
template <typename> void foo (int count) {
int i = {count};
}
template void foo<int> (int);