public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7638: inline friend in template class produces strange error msg
@ 2002-08-19 15:06 tkarkanis
0 siblings, 0 replies; 2+ messages in thread
From: tkarkanis @ 2002-08-19 15:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 7638
>Category: c++
>Synopsis: inline friend in template class produces strange error msg
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Mon Aug 19 14:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: tkarkanis@aw.sgi.com
>Release: 3.1
>Organization:
>Environment:
Red Hat Linux 7.3, IA32
>Description:
The compiler rejects the input in the attached file. I'm
not sure that the input is legal (because it's kind of
strange to have an inline definition of a friend function
in a template class). I assume it is legal because every
other compiler that I tried (IRIX, Solaris, HP-UX) accepts
the input.
Even if the input is correctly
rejected, the error message is incorrect because the friend
function is neither virtual nor abstract.
lnx-stdbld:~/tmp> g++3 -c ostream.cpp
ostream.cpp:19: cannot declare parameter `arg' to be of type `Complex<Float>'
ostream.cpp:19: because the following virtual functions are abstract:
ostream.cpp:7: ostream& operator<<(ostream&, const Complex<Float>&)
>How-To-Repeat:
g++3 -c ostream.cpp
>Fix:
A workaround is to take the friend function definition out
of the class definition.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="ostream.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="ostream.cpp"
Y2xhc3Mgb3N0cmVhbTsKCnRlbXBsYXRlPHR5cGVuYW1lIEZsb2F0PgpjbGFzcyBDb21wbGV4CnsK
ICAgIGZyaWVuZCBvc3RyZWFtJiBvcGVyYXRvcjw8KCBvc3RyZWFtJiBvcywgY29uc3QgQ29tcGxl
eCYgYyApCiAgICAgICAgeyByZXR1cm4gb3M7IH0KICAgIAogICAgRmxvYXQgbV9yZSwgbV9pbTsK
cHVibGljOgogICAgCiAgICBDb21wbGV4JiBvcGVyYXRvcis9KCBDb21wbGV4ICk7Cn07CgoKdGVt
cGxhdGU8dHlwZW5hbWUgRmxvYXQ+CmlubGluZSBDb21wbGV4PEZsb2F0PiYKQ29tcGxleDxGbG9h
dD46Om9wZXJhdG9yKz0oIENvbXBsZXggYXJnICkKewogICAgcmV0dXJuICp0aGlzOwp9Cg==
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/7638: inline friend in template class produces strange error msg
@ 2002-10-03 8:37 lerdsuwa
0 siblings, 0 replies; 2+ messages in thread
From: lerdsuwa @ 2002-10-03 8:37 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, tkarkanis
Synopsis: inline friend in template class produces strange error msg
State-Changed-From-To: open->analyzed
State-Changed-By: lerdsuwa
State-Changed-When: Thu Oct 3 08:37:43 2002
State-Changed-Why:
Confirmed.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7638
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-10-03 15:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-19 15:06 c++/7638: inline friend in template class produces strange error msg tkarkanis
2002-10-03 8:37 lerdsuwa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).