<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 - LLVM 6 _Generic keyword with OpenCL produces false error"
href="https://bugs.llvm.org/show_bug.cgi?id=35826">35826</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LLVM 6 _Generic keyword with OpenCL produces false error
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rakka@runbox.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=19629" name="attach_19629" title="reproducer">attachment 19629</a> <a href="attachment.cgi?id=19629&action=edit" title="reproducer">[details]</a></span>
reproducer
Compiling the attached code sample with LLVM 5 works, but fails with LLVM 6.
--------------------------------------
$ <LLVM_5>/bin/clang -x cl -cl-kernel-arg-info -cl-std=CL1.2 -o /tmp/test2.o
-c test1.cl -include <LLVM_5>/lib/clang/5.0.1/include/opencl-c.h
... no error
--------------------------------------
$ <LLVM_6>/bin/clang -x cl -cl-kernel-arg-info -cl-std=CL1.2 -o /tmp/test2.o
-c test1.cl -include <LLVM_6>/lib/clang/6.0.0/include/opencl-c.h
test1.cl:13:18: error: controlling expression type 'stype' (aka 'float') not
compatible with any generic association type
_Static_assert ( is_floating(stype), "stype");
^~~~~~~~~~~~~~~~~~
test1.cl:3:35: note: expanded from macro 'is_floating'
# define is_floating(T) _Generic((T)(0.0f), float: 1, double: 1)
^~~~~~~~~
1 error generated.
-------------------------------------
I understand _Generic is a C11 keyword, but Clang documentation states:
As an extension, the C11 generic selection expression is available in all
languages supported by Clang. The syntax is the same as that given in the C11
standard.
has this changed ?</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>