[llvm-bugs] [Bug 27558] New: Cannot create a non-constant pointer to member function error with using-declaration

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 28 10:04:56 PDT 2016


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

            Bug ID: 27558
           Summary: Cannot create a non-constant pointer to member
                    function error with using-declaration
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvmlm at bithub.de
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16278
  --> https://llvm.org/bugs/attachment.cgi?id=16278&action=edit
Small example to reproduce the issue

Clang 3.8 refuses to provide the member function pointer when the member
function was introduced via a using-declaration and its origin has a dependent
name.

The attached snippet fails to compile with:

member-fn.cpp:11:19: error: cannot create a non-constant pointer to member
function
                auto memberfn = &B<Args...>::f;

As a workaround the name of the base class can be used to retrieve the member
function pointer.

The example compiles with Clang 3.7, GCC 5.3/6 and MSVC++ 12.0.

-- 
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/20160428/392e090d/attachment.html>


More information about the llvm-bugs mailing list