This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/58708] string literal operator templates broken
- From: "mustrumr97 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Oct 2013 06:41:54 +0000
- Subject: [Bug c++/58708] string literal operator templates broken
- Auto-submitted: auto-generated
- References: <bug-58708-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58708
--- Comment #3 from Hristo Venev <mustrumr97 at gmail dot com> ---
#include <iostream>
template<typename CharT, CharT... str>
void operator""_foo(){
CharT arr[]{str...};
for(CharT i:arr) std::cout<<(int)i<<' ';
}
int main(){
U"\x10000\x10001\x10002"_foo;
}
Current output: "0 0 1 0 1 0 1 0 2 0 1 0 0 0 0 "
Expected output: "65536 65537 65538 "
Without the \0, char32_t's instead of bytes.
The author of the paper intended CharT to be unqualified.