<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 - incorrect diagnostic illegal initializer type with _Atomic static initialization"
href="https://bugs.llvm.org/show_bug.cgi?id=36757">36757</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>incorrect diagnostic illegal initializer type with _Atomic static initialization
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>6.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>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mib.bugzilla@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>This is similar to <a class="bz_bug_link
bz_status_NEW "
title="NEW - Clang prints illegal initializer type '_Atomic(unsigned long long)' for valid code"
href="show_bug.cgi?id=28440">https://bugs.llvm.org/show_bug.cgi?id=28440</a>, but slightly
different. It is cut down from OpenAL. We are compiling this application using
gcc7 headers.
Here is the reduced test case,
typedef _Atomic struct { _Bool __val; } atomic_flag;
static atomic_flag LoadedHrtfLock = { 0 };
/usr/bin/clang -c test.c
test.c:3:37: error: illegal initializer type 'atomic_flag' (aka '_Atomic(struct
(anonymous struct at test.c:1:17))')
static atomic_flag LoadedHrtfLock = { 0 } ;
^
1 error generated.
$ /usr/bin/clang -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
--Melanie Blower, I work for Intel on the Intel c++ compiler</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>