<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 - Should have __has_feature for GCC-compatible __auto_type"
href="https://bugs.llvm.org/show_bug.cgi?id=32052">32052</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Should have __has_feature for GCC-compatible __auto_type
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.9
</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>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>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>m-llvm@bodyfour.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>In 2015 (r252690), clang added support for GCC 4.9's "__auto_type" but as far
as I can tell there is no __has_feature() test to determine if the compiler
version you're using supports it or not. i.e. the following compiles fine with
the latest Xcode:
#if __has_feature(__auto_type)
#error "has feature"
#endif
#if __has_extension(__auto_type)
#error "has extension"
#endif
#if __has_attribute(__auto_type)
#error "has attribute"
#endif
int main()
{
__auto_type x = 5;
return x;
}
Right now I don't have a source clang build handy (I am just using Xcode's
clang) but I grepped around the cfe-3.9.1 code and I couldn't find it there
either. There is of course __has_feature(cxx_auto_type), but that's for the
C++11 "auto", not the GNU C __auto_type. Perhaps can you add a
__has_feature(c_auto_type) or __has_feature(gnu_auto_type) in the future?</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>