<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 --- - Unknown identifier in _Generic throws obscure compiler error message"
href="https://llvm.org/bugs/show_bug.cgi?id=22934">22934</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Unknown identifier in _Generic throws obscure compiler error message
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ed@80386.nl
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Consider the following piece of code:
void banana(void);
int main() {
_Generic(hello, int: banana)();
}
This shouldn't compile, as "hello" is undeclared. Clang 3.4.1 will throw the
following compiler error:
bla.c:3:12: error: use of undeclared identifier 'hello'
_Generic(hello, int: banana)();
^
1 error generated.
Now fast forward to:
clang version 3.7.0 (trunk 232255)
we see that Clang generates the following error:
bla.c:3:31: error: called object type '<dependent type>' is not a function or
function pointer
_Generic(hello, int: banana)();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
1 error generated.
It is no longer obvious what causes compilation to fail.</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>