This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: problem with explicit template instantiation and -frepo
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: Re: problem with explicit template instantiation and -frepo
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Date: Thu, 15 Jul 1999 18:37:52 -0500 (CDT)
- CC: snyder at fnal dot gov
- Reply-to: rittle at rsch dot comm dot mot dot com
; rm -f t.rpo
; cat t.C
template<class A>
class B
{
public:
B (void);
virtual ~B (void);
};
template class B<int>;
; g++ -V2.95 -frepo -c t.C
; g++ -V2.95 -frepo -c t.C
t.C:9: duplicate explicit instantiation of `class B<int>'
The following patch allows my huge base of software (ACE/TAO) to
compile and then recompile without first removing all .rpo files.
Sorry it isn't pretty...
; ccvs diff -u pt.c
Index: pt.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/cp/pt.c,v
retrieving revision 1.307
diff -u -r1.307 pt.c
--- pt.c 1999/06/14 15:56:12 1.307
+++ pt.c 1999/07/15 23:35:21
@@ -9094,8 +9094,10 @@
If CLASSTYPE_INTERFACE_ONLY, then the first explicit
instantiation was `extern', and if EXTERN_P then the second
is. Both cases are OK. */
+#if 0
if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p)
cp_error ("duplicate explicit instantiation of `%#T'", t);
+#endif
/* If we've already instantiated the template, just return now. */
if (!CLASSTYPE_INTERFACE_ONLY (t))