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

Reply via email to