<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - __cpp_threadsafe_static_init is not defined"
href="https://bugs.llvm.org/show_bug.cgi?id=47012">47012</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>__cpp_threadsafe_static_init is not defined
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>noloader@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>