[PATCH] D54472: Disable invalid isPodLike<> specialization

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 21 03:56:47 PST 2019


fedor.sergeev added a comment.

And the smallest testcase I'v been able to come up with:

  #include <type_traits>
  template<class T>
  union trivial_helper {
      T t;
  };
  template <typename AssociatedData> struct TrieNode {
    AssociatedData ExtraData;
  };
  struct StackIdData {
    int x [std::is_copy_assignable<trivial_helper<TrieNode<StackIdData>*>>::value + 1];
  };
  ...
  copyable_test_small.cpp: In instantiation of ‘struct TrieNode<StackIdData>’:
  gcc/include/c++/4.9.2/type_traits:1183:45:   required by substitution of ‘template<class _Tp1, class _Up1, class> static std::true_type std::__is_assignable_helper<_Tp, _Up>::__test(int) [with _Tp1 = trivial_helper<TrieNode<StackIdData>*>&; _Up1 = const trivial_helper<TrieNode<StackIdData>*>&; <template-parameter-1-3> = <missing>]’
  gcc/include/c++/4.9.2/type_traits:1192:30:   required from ‘class std::__is_assignable_helper<trivial_helper<TrieNode<StackIdData>*>&, const trivial_helper<TrieNode<StackIdData>*>&>’
  gcc/include/c++/4.9.2/type_traits:1197:12:   required from ‘struct std::is_assignable<trivial_helper<TrieNode<StackIdData>*>&, const trivial_helper<TrieNode<StackIdData>*>&>’
  gcc/include/c++/4.9.2/type_traits:1209:12:   required from ‘struct std::__is_copy_assignable_impl<trivial_helper<TrieNode<StackIdData>*>, true>’
  gcc/include/c++/4.9.2/type_traits:1215:12:   required from ‘struct std::is_copy_assignable<trivial_helper<TrieNode<StackIdData>*> >’
  copyable_test_small.cpp:10:73:   required from here
  copyable_test_small.cpp:7:18: error: ‘TrieNode<AssociatedData>::ExtraData’ has incomplete type
     AssociatedData ExtraData;
                    ^
  copyable_test_small.cpp:9:8: error: forward declaration of ‘struct StackIdData’
   struct StackIdData {
          ^

It does not fail if trivial_helper wrapper is removed from the construct (just passing TrieNode to is_copy_assignable).
So, llvm::detail::trivial_helper triggers something inside the gcc4.9.2 traits implementation.
I'm not sure what the workaround could be...


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54472/new/

https://reviews.llvm.org/D54472





More information about the llvm-commits mailing list