<html>
<head>
<base href="http://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 --- - Allow reinterpret_cast in constant expression when -fms-compatibility is enabled"
href="http://llvm.org/bugs/show_bug.cgi?id=17410">17410</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Allow reinterpret_cast in constant expression when -fms-compatibility is enabled
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</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>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>p_hampson@wargaming.net
</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>Currently Clang cannot use the DIJOFS_nnn and similar CPP macros as case labels
as they evaluate to: FIELD_OFFSET(DIJOYSTATE, nnn) which is defined in winnt.h
as:
#define FIELD_OFFSET(type, field) ((LONG)(LONG_PTR)&(((type *)0)->field))
Clang rejects them with:
error : case value is not a constant expression
note: expanded from macro 'FIELD_OFFSET'
note: cast that performs the conversions of a reinterpret_cast is not allowed
in a constant expression
MinGW's w32api package bounced off the same issue, and resolved it by changing
their definition of FIELD_OFFSET to use offsetof, but that's not a great option
for the upstream headers.
<a href="http://sourceforge.net/p/mingw/bugs/693/">http://sourceforge.net/p/mingw/bugs/693/</a></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>