public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: tkarkanis@aw.sgi.com
To: gcc-gnats@gcc.gnu.org
Subject: c++/7638: inline friend in template class produces strange error msg
Date: Mon, 19 Aug 2002 15:06:00 -0000	[thread overview]
Message-ID: <20020819205711.29497.qmail@sources.redhat.com> (raw)


>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==


             reply	other threads:[~2002-08-19 21:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-19 15:06 tkarkanis [this message]
2002-10-03  8:37 lerdsuwa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020819205711.29497.qmail@sources.redhat.com \
    --to=tkarkanis@aw.sgi.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).