summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-25 01:56:13 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-25 01:56:13 +0000
commitfe355a5d1f26c76e04d0f3335f6d2c932a3b1ffe (patch)
tree86b717901752066570c276c96561342b896a1d43
parent973df4d4252fba4f542a7a6cfd8bb667ededc989 (diff)
downloadppe42-gcc-fe355a5d1f26c76e04d0f3335f6d2c932a3b1ffe.tar.gz
ppe42-gcc-fe355a5d1f26c76e04d0f3335f6d2c932a3b1ffe.zip
* pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.
* decl2.c (finish_vtable_vardecl): Don't prune vtables here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30656 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl2.c1
-rw-r--r--gcc/cp/pt.c5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/inline1.C14
4 files changed, 25 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1320b21696c..f9ff0372ce6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+1999-11-24 Mark Mitchell <mark@codesourcery.com>
+
+ * pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.
+
+ * decl2.c (finish_vtable_vardecl): Don't prune vtables here.
+
1999-11-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* decl.c (pushdecl, grokdeclarator): Don't call a variadic
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 21b2d446cf9..617d85426f5 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2608,7 +2608,6 @@ finish_vtable_vardecl (t, data)
/* We don't know what to do with this one yet. */
return 0;
- *t = TREE_CHAIN (vars);
return 0;
}
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 18307b3e9aa..dde6562cd98 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5913,6 +5913,11 @@ tsubst_decl (t, args, type, in_decl)
TREE_TYPE (r) = TREE_TYPE (DECL_INITIAL (r));
}
+ /* If the template variable was marked TREE_ASM_WRITTEN, that
+ means we don't need to write out any of the instantiations
+ either. (__FUNCTION__ and its ilk are marked thusly.) */
+ TREE_ASM_WRITTEN (r) = TREE_ASM_WRITTEN (t);
+
/* Even if the original location is out of scope, the newly
substituted one is not. */
if (TREE_CODE (r) == VAR_DECL)
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/inline1.C b/gcc/testsuite/g++.old-deja/g++.pt/inline1.C
new file mode 100644
index 00000000000..343cd670373
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/inline1.C
@@ -0,0 +1,14 @@
+// Build don't link:
+// Special g++ Options: -O2 -Winline
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+inline void f ()
+{
+
+}
+
+void g ()
+{
+ f<int> ();
+}
OpenPOWER on IntegriCloud