egcs-970828 : bad support of friend template

Christophe Réquillart C.Requillart@bull-ingenierie.fr
Tue Sep 2 05:53:00 GMT 1997


egcs doesnot support the friend template as describe in Working Paper
for Draft Proposed International Standard for Information Systems--
                         Programming Language C++ (2 December 1996)


"[14.5.3]
 (...)
2 A friend template may be declared  within  a  non-template  class.   A
  friend  function  template may be defined within a non-template class.
  In these cases, all specializations of the class or function  template
  are friends of the class granting friendship.  [Example:
          class A {
                  template<class T> friend class B; // ok
                  template<class T> friend void f(T){ /* ... */ } // ok
          };
   --end example]"


You can do the following test :

template <class T>
class A
{
};

class B
{
  template <class T> friend class A;
};


compile this and you will have : parse error before `template'
begin:          vcard
fn:             Réquillart, Christophe
n:              Réquillart;Christophe
org:            Bull Ingénierie
adr:            12, rue de Paris;;;Le Pecq;;78230;France
email;internet: C.Requillart@bull-ingenierie.fr
tel;work:       0130871285
tel;fax:        0130871267
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
end:            vcard



More information about the Gcc-bugs mailing list