<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 --- - Enhance diagnostic for "Invalid suffix on integer constant" for hexadecimal constants ending in E"
href="https://llvm.org/bugs/show_bug.cgi?id=26910">26910</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Enhance diagnostic for "Invalid suffix on integer constant" for hexadecimal constants ending in E
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</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>christophe@dinechin.org
</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>Consider the following snippet of code:
int x = 0xAE+foo;
clang currently issues the diagnostic:
/tmp/glop.c:1:11: error: invalid suffix '+foo' on integer constant
This is actually correct, because this is treated as a single preprocessing
token. See example in 2.4.3 in original C++ standard that states:
4 [Example: The program fragment 0xe+foo is parsed as a preprocessing
number token (one that is not a valid floating or integer literal token), even
though a parse as three preprocessing tokens 0xe, +, and foo might produce a
valid expression (for example, if foo were a macro defined as 1). Similarly,
the program fragment 1E1 is parsed as a preprocessing number (one that is a
valid floating literal token), whether or not E is a macro name. — end example
]
However, I think it is desirable to emit a better diagnostic in this specifc
case, since I believe it is very confusing for the average programmer.</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>