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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to