https://bugs.llvm.org/show_bug.cgi?id=40524

Eric Fiselier <e...@efcs.ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |e...@efcs.ca

--- Comment #1 from Eric Fiselier <e...@efcs.ca> ---
Invoking a pointer to a 'const &' member function on an rvalue is a C++2a
extension. Prior to C++2a GCC and Clang accept it as conforming extension. But
in order for the extension to be conforming, it has to be disabled in SFINAE
contexts -- otherwise it could change the meaning of well-defined code.

If you compile your example with -std=c++17 -pedantic-errors then both
invocations are rejected. (https://godbolt.org/z/ofS4AB)

Both libc++ and libstdc++ reject this prior to C++2a but accept it after. This
is the correct behavior. There is nothing to do here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to