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++/70097] New: Cannot assign ref-qualified non-static member function


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70097

            Bug ID: 70097
           Summary: Cannot assign ref-qualified non-static member function
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ldionne.2 at gmail dot com
  Target Milestone: ---

The following code fails to compile on GCC trunk:

    struct F { void member() & { } };
    using Member = void()&;
    Member F::* fptr = &F::member;

The error is:

    [...]: error: cannot convert âvoid (F::*)() &â to âvoid (F::*)()â in
initialization
     Member F::* fptr = &F::member;
                            ^~~~~~

Live example: http://melpon.org/wandbox/permlink/kizV7mkIaHTnMTkd

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