[LLVMbugs] [Bug 18104] New: The name of a function doesn't decays to a function pointer automatically

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Nov 30 18:03:25 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=18104

            Bug ID: 18104
           Summary: The name of a function doesn't decays to a function
                    pointer automatically
           Product: clang
           Version: 3.3
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ldesegur at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Based on the C++ Programming Language 4th Edition (C++11), the following
example compiles with GNUC++4.9 but needs a function pointer in front of the
function name when using CLANG.

#include <future>

void f()
{
}

int main()
{
    packaged_task<void()> pt {&f}; //use '&' to compile
}


I get this error when the ampersand is removed:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:1670:45:
error: multiple overloads of 'address' instantiate to the same signature
'const_pointer (const_reference) const noexcept'
    _LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const
_NOEXCEPT


clang -v
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

-- 
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/20131201/3487027e/attachment.html>


More information about the llvm-bugs mailing list