summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1995-03-17 21:24:25 +0000
committernate <nate@FreeBSD.org>1995-03-17 21:24:25 +0000
commita8fc310bb0b1cdc3a7519d60fedb71ff5054364d (patch)
treed3bc53511435bbc283c044779238aa26e0069ddf /gnu
parent51b264e4f12cb0fffa6e930f62ad3b37fe68c9ed (diff)
downloadFreeBSD-src-a8fc310bb0b1cdc3a7519d60fedb71ff5054364d.zip
FreeBSD-src-a8fc310bb0b1cdc3a7519d60fedb71ff5054364d.tar.gz
Gcc v2.6.3 currently has a problem with templates. Specifically, with
default switches, template functions get EXTERNAL linkage in each file in which they occur, causing multiple definition errors during linking. The enclosed patch (from gnu.g++.bug) appears to solve the problem (I enclose the accompanying message as well). This patch fixes the multiply defined template functions bug which was introduced in 2.6.1. Submitted by: "Justin T. Gibbs" <gibbs@estienne.cs.berkeley.edu> Obtained from: Jason Merrill at cygnus support on G++ mailing list
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/cc/cc1plus/pt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gnu/usr.bin/cc/cc1plus/pt.c b/gnu/usr.bin/cc/cc1plus/pt.c
index c3ff8d8..cb6b0e4 100644
--- a/gnu/usr.bin/cc/cc1plus/pt.c
+++ b/gnu/usr.bin/cc/cc1plus/pt.c
@@ -2302,6 +2302,10 @@ do_pending_expansions ()
else if (! flag_implicit_templates)
DECIDE (0);
+ if (i->interface == 1)
+ /* OK, it was an implicit instantiation. */
+ TREE_PUBLIC (t) = 0;
+
/* If it's a method, let the class type decide it.
@@ What if the method template is in a separate file?
Maybe both file contexts should be taken into account?
OpenPOWER on IntegriCloud