Bug 9938 - bug with nested friend of a nested class of a templated class
Summary: bug with nested friend of a nested class of a templated class
Status: RESOLVED DUPLICATE of bug 9602
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2.2
: P3 normal
Target Milestone: ---
Assignee: Wolfgang Bangerth
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2003-03-04 12:36 UTC by jasonkim
Modified: 2003-06-12 00:15 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
gcc32tst.cc (313 bytes, application/octet-stream)
2003-05-21 15:17 UTC, jasonkim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jasonkim 2003-03-04 12:36:00 UTC
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.

Release:
3.2.2

Environment:
Linux (Redhat 7.2)

How-To-Repeat:
The problem can be seen by simply compiling the supplied code snippet.

g++ -c gcc32tst.cc
Comment 1 jasonkim 2003-03-04 12:36:00 UTC
Fix:
move the definition of the offending friend function out of the body of nested class and supply -Wno-non-template-friend
Comment 2 Wolfgang Bangerth 2003-03-04 15:51:26 UTC
*** This bug has been marked as a duplicate of 9602 ***