[PATCH] D54472: Disable invalid isPodLike<> specialization

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 06:51:29 PST 2018


serge-sans-paille created this revision.
serge-sans-paille added reviewers: jwakely, chandlerc.
Herald added subscribers: llvm-commits, kristina, dexonsmith.

As noted in https://bugs.llvm.org/show_bug.cgi?id=36651, the specialization for isPodLike<std::pair<...>> did not match the expectation of `std::is_trivially_copyable` which makes the `memcpy` optimization invalid.

This patch ensure that for whatever specialization of `isPodLike` we have, it is consistent with `std::is_trivially_copyable`.

The following specialization were invalid:

- `std::pair<T0, T1>`
- `llvm::Optional<T>`
- `llvm::SuccIterator<T, U>`

Note that GCC warns about this UB, but this got silented by https://reviews.llvm.org/D50296


Repository:
  rL LLVM

https://reviews.llvm.org/D54472

Files:
  include/llvm/ADT/DenseMap.h
  include/llvm/ADT/Optional.h
  include/llvm/ADT/SmallVector.h
  include/llvm/IR/CFG.h
  include/llvm/Support/type_traits.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54472.173838.patch
Type: text/x-patch
Size: 4254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181113/bde9f97b/attachment.bin>


More information about the llvm-commits mailing list