Code: Select all
// a.cpp
typedef char16_t mychar;
Code: Select all
franta@here ~ $clang++ -fno-PIE --target=x86_64-unknown-windows -c a.cpp
a.cpp:2:9: error: unknown type name 'char16_t'
typedef char16_t mychar;
^
1 error generated.
Code: Select all
franta@here ~ $ clang++ -fno-PIE --target=x86_64-unknown-linux -c a.cpp
franta@here ~ $
Code: Select all
franta@here ~ $ clang++ --version
clang version 16.0.5
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/16/bin
Configuration file: /etc/clang/clang++.cfg
Is this a bug, a feature, something else?
However, if I change char16_t to built-in __char16_t:
Code: Select all
// b.cpp
typedef __char16_t mychar;
Code: Select all
franta@here ~ $ clang++ -fno-PIE --target=x86_64-unknown-linux -c b.cpp
franta@here ~ $
upstream and that there is a typedef missing in one of the headers that are loaded implicitly.
I don't understand the whole interplay of the pieces involved enough though to figure out,
why it works with one triple, but not the other.
Any suggestions how to track this down?

