>Submitter-Id:  net
>Originator:    
>Organization:  LRDE
>Confidential:  no
>Synopsis: ICE when declaring a function already defined as a friend method of 
>a template class
>Severity: serious
>Priority: medium
>Category: c++
>Class: ice-on-legal-code
>Release:       3.1.1 20020606 (Debian prerelease) (Debian testing/unstable)
>Environment:
System: Linux ouarzazate 2.4.17 #1 Sun Mar 10 19:25:30 CET 2002 i686 unknown
Architecture: i686

        
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: /mnt/data/gcc-3.1/gcc-3.1-3.1.1ds1/src/configure -v 
--enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr 
--mandir=/usr/share/man --infodir=/usr/share/info 
--with-gxx-include-dir=/usr/include/g++-v3-3.1 --enable-shared 
--with-system-zlib --enable-long-long --enable-nls --without-included-gettext 
--enable-clocale=gnu --enable-threads=posix --enable-java-gc=boehm 
--enable-objc-gc i386-linux
>Description:

gcc does not tolerate a redeclaration of a friend method,
oustside of its original class, when the parameter is
template dependent.

>How-To-Repeat: 

template <class T>
struct A
{
  friend void bar(A<T> a) {}
};

void bar(A<int>);

int main()
{
  A<int> a;

  bar(a);
}

>Fix:


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


Reply via email to