http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57252

            Bug ID: 57252
           Summary: GCC does not treat ref-qualified overload set as
                    ambiguous
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lucdanton at free dot fr

Created attachment 30099
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30099&action=edit
Minimal testcase

$ g++-snapshot --version
g++-snapshot (Debian 20130509-1) 4.9.0 20130509 (experimental) [trunk revision
198734]

$ cat main.cpp 
struct foo {
    void bar() & {}
    void bar() && {}
};

int main()
{
    // No complaints
    auto p = &foo::bar;
    // error: pointer-to-member-function type 'void (foo::*)() &' requires an
lvalue
    (foo{}.*p)();
}

$ g++-snapshot -std=c++11 main.cpp 
main.cpp: In function 'int main()':
main.cpp:11:13: error: pointer-to-member-function type 'void (foo::*)() &'
requires an lvalue
     (foo{}.*p)();
             ^

I would have thought &foo::bar would have been ambiguous outside of any
context.

Reply via email to