This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35650] New: Can't bind ref-to-function through using-decl. in namespace
- From: "gcc-bugzilla at contacts dot eelis dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Mar 2008 18:06:28 -0000
- Subject: [Bug c++/35650] New: Can't bind ref-to-function through using-decl. in namespace
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider:
void f();
namespace N { using ::f; }
void h()
{
void (& a)() = f; // ok
void (& b)() = N::f;
// error: invalid initialization of non-const reference of
// type â??void (&)()â?? from a temporary of type â??void ()()â??
}
Since in h, f and N::f are simply two ways of naming the same function, the
error seems unwarranted to me.
Comeau 4.3.9 accepts the code.
--
Summary: Can't bind ref-to-function through using-decl. in
namespace
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gcc-bugzilla at contacts dot eelis dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35650