<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 - Invalid literal check for macro arguments"
href="https://bugs.llvm.org/show_bug.cgi?id=33733">33733</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Invalid literal check for macro arguments
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.9
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>j.llvm.org@lorenz-ho.me
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Hi,
Minimal example:
$ cat main.cpp
#include <iostream>
#define macro(x) #x
int main()
{
std::cout << macro("abc"S) << std::endl;
return 0;
}
g++ 5.4.0:
$ g++ -std=c++11 -Wall -Wextra main.cpp -o main
# (compiles without warnings or errors)
$ ./main
"abc"S
clang++ 3.9.1:
$ clang++ -std=c++11 -Wall -Wextra main.cpp -o main
main.cpp:6:26: error: invalid suffix on literal; C++11 requires a space
between literal and identifier [-Wreserved-user-defined-literal]
std::cout << macro("abc"S) << std::endl;
Assumption:
clang++ checks for the space between literal and identifier (it's only a check)
before precompilation, which is probably wrong, because literal evaluation is
not part of the precompiler?
Thanks on advance,
Johannes</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>