This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56820] elaborated-type-specifier friend incorrectly looked up beyond innermost enclosing namespace
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 16 Nov 2013 16:31:03 +0000
- Subject: [Bug c++/56820] elaborated-type-specifier friend incorrectly looked up beyond innermost enclosing namespace
- Auto-submitted: auto-generated
- References: <bug-56820-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56820
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-11-16
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Confirmed.
namespace outer
{
template<class T> struct B;
namespace inner
{
template<class U> class A
{
template<class T> friend struct B;
A() {}
};
}
template<class T> struct B
{
B() { inner::A<int> a; }
};
}
outer::B<int> b;
The friend declaration only matches outer::B when both A and B are class
templates. If either is a non-template then the friend declaration correctly
declares outer::inner::B.