Commit db77ef4c by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

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
parent e6ddcef6
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> 2003-02-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9459 PR c++/9459
......
...@@ -8290,8 +8290,7 @@ tsubst_copy_and_build (t, args, complain, in_decl) ...@@ -8290,8 +8290,7 @@ tsubst_copy_and_build (t, args, complain, in_decl)
initializers as they are identifier nodes which will be initializers as they are identifier nodes which will be
looked up by digest_init. */ looked up by digest_init. */
purpose_p = !(type && IS_AGGR_TYPE (type)); purpose_p = !(type && IS_AGGR_TYPE (type));
for (elts = tsubst_copy (CONSTRUCTOR_ELTS (t), args, complain, for (elts = CONSTRUCTOR_ELTS (t);
in_decl);
elts; elts;
elts = TREE_CHAIN (elts)) elts = TREE_CHAIN (elts))
{ {
......
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> Sun Feb 16 23:08:19 CET 2003 Jan HUbicka <jh@suse.cz>
* gcc.dg/c90-const-expr-3.c (DZERO): New static variable * gcc.dg/c90-const-expr-3.c (DZERO): New static variable
......
// { 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);
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