This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/59256] qualified name in friend function declaration doesn't match previous declaration in inline namespace
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 26 Mar 2015 15:41:36 +0000
- Subject: [Bug c++/59256] qualified name in friend function declaration doesn't match previous declaration in inline namespace
- Auto-submitted: auto-generated
- References: <bug-59256-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59256
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
Assignee|jason at gcc dot gnu.org |unassigned at gcc dot gnu.org
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
A related testcase:
inline namespace A {
void f();
}
class B
{
B();
friend void ::f();
};
void A::f() { B b; }
int main()
{
f();
}
It turns out that friend matching code doesn't support inline namespaces very
thoroughly. set_decl_namespace handles this sort of thing for some cases, but
it punts on templates and then tsubst_friend_function doesn't do anything about
inline namespaces.
But this is too complicated to fix for GCC 5, so I'm unassigning myself.