[llvm-bugs] [Bug 40524] INVOKEing pointer to const&-qualified member function with rvalue results in an error

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 30 14:39:20 PST 2019


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

Eric Fiselier <eric at efcs.ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |eric at efcs.ca

--- Comment #1 from Eric Fiselier <eric at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190130/7cc08361/attachment.html>


More information about the llvm-bugs mailing list