pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.
authorMark Mitchell <mark@codesourcery.com>
Thu, 25 Nov 1999 01:56:13 +0000 (01:56 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 25 Nov 1999 01:56:13 +0000 (01:56 +0000)
* pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.

* decl2.c (finish_vtable_vardecl): Don't prune vtables here.

From-SVN: r30656

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/pt.c
gcc/testsuite/g++.old-deja/g++.pt/inline1.C [new file with mode: 0644]

index 1320b21696cd8e6aa43b454b00062c1e7684cb2f..f9ff0372ce696e93aa9f9964e310121baf3d2c59 100644 (file)
@@ -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
index 21b2d446cf99830f0a495cab2ed881a3ad404759..617d85426f5d8387402ae9b7e0b0eb8a69f53a8d 100644 (file)
@@ -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;
 }
 
index 18307b3e9aad7777fb9e19e069f11980dcce8caf..dde6562cd982dd69f0e3191c8d71681fecf97577 100644 (file)
@@ -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 (file)
index 0000000..343cd67
--- /dev/null
@@ -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> ();
+}