This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/5019: ICE on templated friends
- From: rodrigc at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, isabelle dot hurbain at free dot fr, nobody at gcc dot gnu dot org
- Date: 6 Dec 2001 04:44:42 -0000
- Subject: Re: c++/5019: ICE on templated friends
Synopsis: ICE on templated friends
State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Wed Dec 5 20:44:42 2001
State-Changed-Why:
I don't think this code is legal.
gcc 3.0.3 does not ICE on this code, but issues the following
compilation errors:
In file included from driver.cpp:1:
amatrix.h:13: friend declaration requires class-key, i.e. `friend class
amatrix<another, M>'
amatrix.h: In constructor `amatrix<t_element, N>::amatrix(const
amatrix<another, M>&) [with another = double, unsigned int M = 4, t_element
= int, unsigned int N = 4]':
driver.cpp:8: instantiated from here
amatrix.h:15: `double amatrix<double, 4>::m_data[4][4]' is private
amatrix.h:46: within this context
amatrix.h:49: `cerr' undeclared (first use this function)
amatrix.h:49: (Each undeclared identifier is reported only once for each
function it appears in.)
Compiling with the Digital Unix C++ compiler
yielded the following compilation error:
cxx: Error: amatrix.h, line 13: expected an identifier
friend amatrix<another, M>;
So this code is questionable. Since gcc 3.0.3 does not
ICE on this code, I am closing this PR.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5019&database=gcc