<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - std::atomic for non-Clang is not a literal type" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24114&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=osY-clSeXBO90nrHA6FxMOPQ2-XQS_l8UwjR05INTNc&s=bKZT4kfEPcAuNKXwhDMDiyrixhikhsViIokGCxmum5I&e=">24114</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>std::atomic for non-Clang is not a literal type
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>thiago@kde.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Source code:
constexpr std::atomic<int> i = { 42 };
This fails to compile because the __gcc_atomic struct's value constructor is
missing constexpr. Please add it.
Compilation error with ICC 14.0 on OS X with the libc++ from XCode 6.4 (I don't
know how to obtain the exact version of libc++):
Line 1: error: expression must have a constant value
extern constexpr std::atomic<int> i{ 42 };
^
Compilation errors (trimmed) with GCC 4.9 on Linux with libc++ from trunk as of
r242056:
error: the type ‘const std::__1::atomic<int>’ of constexpr variable ‘i’ is not
literal
atomic:996:8: note: ‘std::__1::atomic<int>’ is not literal because:
atomic:996:8: note: base class ‘std::__1::__atomic_base<int, true>’ of
‘std::__1::atomic<int>’ is non-literal
atomic:915:8: note: ‘std::__1::__atomic_base<int, true>’ is not literal
because:
atomic:915:8: note: base class ‘std::__1::__atomic_base<int, false>’ of
‘std::__1::__atomic_base<int, true>’ is non-literal
atomic:820:8: note: ‘std::__1::__atomic_base<int, false>’ is not literal
because:
atomic:822:26: note: non-static data member ‘std::__1::__atomic_base<int,
false>::__a_’ has non-literal type
atomic:555:8: note: ‘std::__1::__gcc_atomic::__gcc_atomic_t<int>’ is not
literal because:
atomic:555:8: note: ‘std::__1::__gcc_atomic::__gcc_atomic_t<int>’ is not an
aggregate, does not have a trivial default constructor, and has no constexpr
constructor that is not a copy or move constructor</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>