This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with explicit template instantiation and -frepo



; 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))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]