public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/9938: bug with nested friend of a nested class of a templated class
@ 2003-03-04 15:51 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-03-04 15:51 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jasonkim, nobody

Synopsis: bug with nested friend of a nested class of a templated class

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Tue Mar  4 15:51:26 2003
State-Changed-Why:
    Duplicate of 9602, which is fixed on 3.3 and mainline.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9938


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/9938: bug with nested friend of a nested class of a templated class
@ 2003-03-04 12:36 jasonkim
  0 siblings, 0 replies; 2+ messages in thread
From: jasonkim @ 2003-03-04 12:36 UTC (permalink / raw)
  To: gcc-gnats


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-04 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-04 15:51 c++/9938: bug with nested friend of a nested class of a templated class bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-03-04 12:36 jasonkim

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).