This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/58708] string literal operator templates broken


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]