<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 --- - Bugs in __builtin_classify_type implementation"
href="https://llvm.org/bugs/show_bug.cgi?id=26449">26449</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Bugs in __builtin_classify_type implementation
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>andreybokhanko@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>There are several bugs in __builtin_classify_type implementation:
1) It doesn't support member functions, so the following program crashes clang:
lass cl {
public:
void bar() {}
};
...
int res = __builtin_classify_type(&cl::bar);
2) It returns enumeral_type_class for enums, function_type_class for functions
and array_type_class for arrays in both C and C++ modes. However, gcc returns
integer_type_class for enums and pointer_type_class for arrays and functions in
C mode -- which is correct, as conversions between enums and ints and function
pointers and arrays and pointers can happen everywhere in C. (gcc returns the
same as what clang does in C++ mode, however.)
2) It returns string_type_class for chars, which is odd and doesn't match what
gcc does.
Yours,
Andrey
======
Software Engineer
Intel Compiler Team</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>