This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/35650] New: Can't bind ref-to-function through using-decl. in namespace


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]