You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UTF-16 character literals get illegally formatted #945
$ cat /tmp/foo.cpp
#include <string>
int main(int argc, char **argv) {
char16_t c = u'\u007f';
}
$
After running uncrustify uncrustify 0.64_d, I get the following:
$ cat /tmp/newfoo.cpp
#include <string>
int main(int argc, char **argv) {
char16_t c = u '\u007f';
}
$
The space inserted between the u and the first single quote makes the character literal unpareable.
$ g++ -std=gnu++11 -o /tmp/newfoo.o -c /tmp/newfoo.cpp
/tmp/newfoo.cpp: In function 'int main(int, char**)':
/tmp/newfoo.cpp:4:16: error: 'u' was not declared in this scope
char16_t c = u '\u007f';
^
$
Yes, the merged commit, and the ones before it handle the prefixes only for C++. I didn't know C11 supports those too. A PR for that will be submitted soon.
Activity
mihaipopescu commentedon Jan 20, 2017
Oh, I think uncrustify doesn't expects the new string or char literals from C++11. Need to add support for that.
j000 commentedon Nov 19, 2017
Does that merged PR fix it for C++? I'm having the same issue with C...
u"test"->u "test"CDanU commentedon Nov 20, 2017
Yes, the merged commit, and the ones before it handle the prefixes only for C++. I didn't know C11 supports those too. A PR for that will be submitted soon.
j000 commentedon Nov 20, 2017
I just wasn't sure if it's working properly for C++, so I asked. It's good to know it does :) Thanks!
Add .uncrustify.cfg