This matches gcc behavior
Details
- Reviewers
steven.zhang hubert.reinterpretcast nemanjai qiucf rsmith - Group Reviewers
Restricted Project - Commits
- rG4aa510be78a7: Allow __ieee128 as an alias to __float128 on ppc
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Hi, you mentioned that this patch aliases __ieee128 to __float128 on PPC. But this seems a target-independent change, right?
The change itself looks reasonable since libstdcxx may refer to __ieee128 type.
I agree that this looks fine as long as the title is fixed up - it is not target specific and it is also not __ieee18 but __ieee128. Since it is target independent, you may want @rsmith to have a look as well.
GCC only defines __ieee128 for 64-bit power, and libstdc++ only uses it for 64-bit power if the C library supports it.
GCC doesn't seem to implement this as a keyword?
namespace Q { int __ieee128; } // compiles
Correct. That being said, using an identifier starting with __ is UB in C and C++, so I guess it's not critical (?). I'm open to suggestion on how to implement that behavior in clang though :-)
That seems to be true for __float128 too, even on x86_64. I'll find out what's going on there.
Edit: and also __float80 on x86. Maybe a bug (or "feature") of target-specific built-in types in GCC. I'll find out on Monday.
As Serge said, it's UB to use that as an identifier, so not a show stopper, and Clang and GCC already diverge here for existing types.
I'm open to suggestion on how to implement that behavior in clang though :-)
My suggestion would be "don't", because GCC's behaviour doesn't make sense!
Thanks @hubert.reinterpretcast , @jwakely and @qiucf for the feedback on that review!