aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2004-01-12 20:10:19 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2004-01-12 12:10:19 -0800
commit66e0c440475e00e4e3285ec7a60ba616a20146cc (patch)
tree8439ef5aaf960c564248bf95832df80f5ccb251b /gcc/cp
parentff2aaa93cca8eb386814327694def7ecc0831005 (diff)
downloadgcc-66e0c440475e00e4e3285ec7a60ba616a20146cc.zip
gcc-66e0c440475e00e4e3285ec7a60ba616a20146cc.tar.gz
gcc-66e0c440475e00e4e3285ec7a60ba616a20146cc.tar.bz2
re PR c++/13289 (ICE in regenerate_decl_from_template on recursive template)
2004-01-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> PR c++/13289 * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before calling regenerate_decl_from_template. 2004-01-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> PR c++/13289 * g++.dg/template/instantiate6.C: New test. From-SVN: r75752
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c13
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 48d831e..109dc83 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2004-01-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/13289
+ * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before
+ calling regenerate_decl_from_template.
+
2004-01-12 Scott Brumbaugh <scottb.lists@verizon.net>
PR c++/4100
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 473b6fe..81dd711 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -11016,6 +11016,10 @@ instantiate_decl (tree d, int defer_ok)
if (need_push)
push_to_top_level ();
+ /* Mark D as instantiated so that recursive calls to
+ instantiate_decl do not try to instantiate it again. */
+ DECL_TEMPLATE_INSTANTIATED (d) = 1;
+
/* Regenerate the declaration in case the template has been modified
by a subsequent redeclaration. */
regenerate_decl_from_template (d, td);
@@ -11052,13 +11056,14 @@ instantiate_decl (tree d, int defer_ok)
instantiation. There, we cannot implicitly instantiate a
defined static data member in more than one translation
unit, so import_export_decl marks the declaration as
- external; we must rely on explicit instantiation. */
+ external; we must rely on explicit instantiation.
+
+ Reset instantiated marker to make sure that later
+ explicit instantiation will be processed. */
+ DECL_TEMPLATE_INSTANTIATED (d) = 0;
}
else
{
- /* Mark D as instantiated so that recursive calls to
- instantiate_decl do not try to instantiate it again. */
- DECL_TEMPLATE_INSTANTIATED (d) = 1;
/* This is done in analogous to `start_decl'. It is
required for correct access checking. */
push_nested_class (DECL_CONTEXT (d));