Just like isPodLike already handles pair, it should special-case tuple and array. This is really only useful for GCC before 5.0, so hopefully this workaround won't be around for long.
Details
- Reviewers
- None
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 22432 Build 22432: arc lint + arc unit
Event Timeline
include/llvm/Support/type_traits.h | ||
---|---|---|
59 | I'm not sure what the intent is, but std::tuple is not a POD even when its elements are -- it typically applies the EBO and I'm pretty sure it could actually use other tricks that would not make it a POD. Specifically, that would make it not Standard Layout AFAICT. |
include/llvm/Support/type_traits.h | ||
---|---|---|
59 |
include/llvm/Support/type_traits.h | ||
---|---|---|
59 | Interesting! The idea is to work around GCC < 5 not having std::is_trivially_copyable... and isPodLike already says that std::pair matches isPodLike which is actually not true as you demonstrate. My use case was bit_cast of std::array which *is* trivially copyable. So now I have to change isPodLike to remove the std::pair overload, not add one for std::tuple, and do add one for std::array. I'm therefore not just making it more capable, I'm also fixing a bug with std::pair. To make everything worst, this is slightly inconsistent because of GCC 5! Methink we really want to upgrade minimum compiler past GCC 5. This BoF sounds like a great place to discuss it: |
include/llvm/Support/type_traits.h | ||
---|---|---|
59 | I think I don't want to change isPodLike anymore. It's a crappy alternative to std::is_trivially_copyable. I think I want to special-case bit_cast instead to only check sizeof and builtin (if available) on GCC < 5, and rely on bots to catch bad usage otherwise (that is, most developers will do the full check, and outdated developers will break the bots). I think isPodLike should die, but separately. |
I'm not sure what the intent is, but std::tuple is not a POD even when its elements are -- it typically applies the EBO and I'm pretty sure it could actually use other tricks that would not make it a POD. Specifically, that would make it not Standard Layout AFAICT.