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

            Bug ID: 23733
           Summary: [Windows] Clang doesn't support std::atomic<function
                    pointer> with Microsoft's STL
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

This code doesn't work with clang-cl for Visual Studio 2013:

void test() {
  std::atomic<void (*)()> fptr(nullptr);
  fptr.load();
}

The problem is that in atomic's implementation, all pointer atomics (which
includes pointer-to-function atomics) store a void* internally, and load()
static_casts the void* to the actual pointer type. Apparently, Microsoft's
compiler accepts a static_cast<void (*)()>((void*)0). clang-cl does not.

-- 
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