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

            Bug ID: 47012
           Summary: __cpp_threadsafe_static_init is not defined
           Product: libc++
           Version: 9.0
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: noloa...@gmail.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

It appears Clang does not define __cpp_threadsafe_static_init like it should.
__cpp_threadsafe_static_init signals dynamic initialization and destruction
with concurrency (N2660).

I'm working on OS X 10.12 using Apple's Command Line Tools. Apple's CLT
provides Clang 9:

  $ clang++ --version
  Apple LLVM version 9.0.0 (clang-900.0.39.2)
  Target: x86_64-apple-darwin16.7.0

The test program:

  $ cat TestPrograms/test_cxx11_dyninit.cxx
  int main(int argc, char* argv[])
  {
  #if __cpp_threadsafe_static_init >= 200806L
      int x[1];
  #else
      int x[-1];
  #endif
      return 0;
  }

$ clang++ -std=c++11 TestPrograms/test_cxx11_dyninit.cxx -o a.out
TestPrograms/test_cxx11_dyninit.cxx:7:11: error: 'x' declared as an array with
a
      negative size
    int x[-1];
          ^~
1 error generated.

Adding '-stdlib=libc++' does not help.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to