public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: jasonkim@cis.upenn.edu
To: gcc-gnats@gcc.gnu.org
Subject: c++/9938: bug with nested friend of a nested class of a templated class
Date: Tue, 04 Mar 2003 12:36:00 -0000	[thread overview]
Message-ID: <20030304122617.24978.qmail@sources.redhat.com> (raw)


>Number:         9938
>Category:       c++
>Synopsis:       bug with nested friend of a nested class of a templated class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 04 12:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     jasonkim@cis.upenn.edu
>Release:        3.2.2
>Organization:
>Environment:
Linux (Redhat 7.2)
>Description:
A templated container class defines a nested class (i.e. iterator), which itself defines an inline friend operator function.

gcc 3.2.2 complains that the defined friend operator of the nested class is an abstract method of the nested class!
This results in the inability to instantiate the nested class.

Note that gcc 2.95.3 correctly compiles the supplied code snippet.
>How-To-Repeat:
The problem can be seen by simply compiling the supplied code snippet.

g++ -c gcc32tst.cc 
>Fix:
move the definition of the offending friend function out of the body of nested class and supply -Wno-non-template-friend
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gcc32tst.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcc32tst.cc"

IAp0ZW1wbGF0ZSA8Y2xhc3MgVCwgY2xhc3MgWT4gCmNsYXNzIGNvbnRhaW5lciAgCnsgCnB1Ymxp
YzoKICB0eXBlZGVmIGNvbnRhaW5lcjxULFk+IHRoaXNjbGFzczsKICAKICBUICphcnA7CiAgVCAq
b2k7CiAgCiAgY2xhc3MgaXRlciB7IAogIHByb3RlY3RlZDoKICAgIHRoaXNjbGFzcyAqcDsKICAg
IGludCBpZHg7CiAgcHVibGljOiAgICAKICAgIHZpcnR1YWwgaW5saW5lIGludCBrZXkoKSBjb25z
dCB7IHJldHVybiBpZHg7IH0KICAgIGZyaWVuZCBib29sIG9wZXJhdG9yPT0oY29uc3QgaXRlciAm
eCwgY29uc3QgaXRlciAmeSkgeyAKICAgICAgcmV0dXJuIFRSVUU7CiAgICB9IAogIH07IAoKICBj
bGFzcyBjb25zdF9pdGVyIHsgCiAgcHJvdGVjdGVkOgogICAgY29uc3QgdGhpc2NsYXNzICpwOwog
ICAgaW50IGlkeDsKICBwdWJsaWM6CiAgICB2aXJ0dWFsIGlubGluZSBpbnQga2V5KCkgY29uc3Qg
eyByZXR1cm4gaWR4OyB9CiAgICBmcmllbmQgYm9vbCBvcGVyYXRvcj09KGNvbnN0IGNvbnN0X2l0
ZXIgJngsIGNvbnN0IGNvbnN0X2l0ZXIgJnkpIHsgCiAgICAgIHJldHVybiBUUlVFOwogICAgfSAK
ICB9OwoKICB2aXJ0dWFsIGlubGluZSBib29sIGluc2VydChjb25zdF9pdGVyIGl0LCBUICppdGVt
KSB7CiAgICBhcnBbaXQua2V5KCldID0gKml0ZW07CiAgfQogIAp9OyAKCmludCBtYWluKCkKewog
IGNvbnRhaW5lcjxpbnQsdm9pZD4gYzsKICBjb250YWluZXI8ZmxvYXQsdm9pZD4gZDsKICBjb250
YWluZXI8Y29udGFpbmVyPGludCx2b2lkPix2b2lkID4gZTsKICAKfQo=


             reply	other threads:[~2003-03-04 12:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-04 12:36 jasonkim [this message]
2003-03-04 15:51 bangerth

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=20030304122617.24978.qmail@sources.redhat.com \
    --to=jasonkim@cis.upenn.edu \
    --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).