[Bug preprocessor/64831] New: Preprocessing # operator with C++11 user-defined literal produces bad output
holger.grund@ix-n.net
gcc-bugzilla@gcc.gnu.org
Wed Jan 28 11:34:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64831
Bug ID: 64831
Summary: Preprocessing # operator with C++11 user-defined
literal produces bad output
Product: gcc
Version: 4.9.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: holger.grund@ix-n.net
$ cat t.cpp
#define S1(a) S2(a)
#define S2(a) #a
void foo()
{
S1("bla"_udl);
}
$ c++ t.cpp -E -P
void foo()
{
"\"bla\"_udl";
}
$ c++ t.cpp -E -P -std=c++11
void foo()
{
""bla"_udl";
}
Feeding the resulting output from c++11 mode into the compiler gives an error:
$ c++ t.cpp -E -P | c++ -c -xc++ -std=c++11 -
$ c++ t.cpp -E -P -std=c++11 | c++ -c -xc++ -std=c++11 -
<stdin>: In function ‘void foo()’:
<stdin>:3:8: error: unable to find string literal operator ‘operator""bla’
This breaks https://github.com/icecc/icecream for remote compilation.
More information about the Gcc-bugs
mailing list