This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15453] New: Friend declaration not treated as a declaration in scope.
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 May 2004 03:38:08 -0000
- Subject: [Bug c++/15453] New: Friend declaration not treated as a declaration in scope.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In the following example:
template<typename G, template<typename H> class I = B>
class J;
template<typename C, template<typename D> class E>
class F {
template<typename G, template<typename H> class I = B>
friend
class J;
template<typename K, template<typename L> class M = B>
friend
class N;
friend
class O;
J<int, B>* j;
N<int, B>* n;
O* o;
};
int main() {
return 0;
}
N appears to not be recognized as a template (in the declaration of n) based on its declaration as a template friend, whereas exactly the same declaration with an additional declaration in file scope is acceptable (template class J, declaring j), as is a friend declaration of a plain class. The c++ rules in this area are incomprehensible to me, but admitting friend declarations in one case and not the other seems unreasonable if not incorrect.
Ivan
--
Summary: Friend declaration not treated as a declaration in
scope.
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15453