Bug 15695 - Instantiations of a template cannot be mutual friends?
Summary: Instantiations of a template cannot be mutual friends?
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-28 01:21 UTC by Ivan Godard
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Godard 2004-05-28 01:21:40 UTC
template<typename T> class A;

template<typename T> class A {
public:
    template<typename R>
    friend class A<R>;
    };

int main() {
    return 0;
    }

gets:
~/ootbc/common/test/src$ g++ foo.cc
foo.cc:6: error: partial specialization `A<R>' declared `friend'

Is this a bug, a hole in the language, or are you supposed to declare mutual friendship some other way?

Ivan
Comment 1 Andrew Pinski 2004-05-28 01:29:17 UTC
14.5.3 - Friends [temp.friend], p9, says that "Friend declarations shall not declare partial 
specializations."

I think it is time to sometime to use google to check first if there is a bug.

Also I think this is a hole in the language.