[PATCH] D57018: Fix lvm::is_trivially_copyable portability issues

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 22 06:09:11 PST 2019


uabelho added a comment.

We've been having issues with std::is_trivially_copyable too, and it seems not even this patch solves the problems for us.

I'm running an Ubuntu 14.04 machine with clang 3.6.0 and libstdc++-4.8-dev and now I get the following when I compile on trunk:

In file included from ../utils/TableGen/CodeGenSchedule.cpp:14:
In file included from ../utils/TableGen/CodeGenSchedule.h:18:
In file included from ../include/llvm/ADT/DenseMap.h:16:
In file included from ../include/llvm/ADT/DenseMapInfo.h:16:
In file included from ../include/llvm/ADT/ArrayRef.h:12:
In file included from ../include/llvm/ADT/Hashing.h:48:
In file included from ../include/llvm/Support/Host.h:16:
In file included from ../include/llvm/ADT/StringMap.h:16:
In file included from ../include/llvm/ADT/StringRef.h:12:
In file included from ../include/llvm/ADT/STLExtras.h:19:
In file included from ../include/llvm/ADT/Optional.h:21:
../include/llvm/Support/type_traits.h:127:57: error: object of type 'llvm::detail::trivial_helper<std::pair<void *, unsigned long> >' cannot

    be assigned because its copy assignment operator is implicitly deleted
  static auto get(F*) -> decltype(std::declval<T &>() = std::declval<const T &>(), std::true_type{});
                                                      ^

../include/llvm/Support/type_traits.h:162:7: note: in instantiation of template class

  'llvm::is_copy_assignable<llvm::detail::trivial_helper<std::pair<void *, unsigned long> > >' requested here
  is_copy_assignable<detail::trivial_helper<T>>::value;
  ^

../include/llvm/ADT/SmallVector.h:184:30: note: in instantiation of template class 'llvm::is_trivially_copyable<std::pair<void *, unsigned

  long> >' requested here

template <typename T, bool = is_trivially_copyable<T>::value>

  ^

../include/llvm/ADT/SmallVector.h:321:32: note: in instantiation of default argument for 'SmallVectorTemplateBase<std::pair<void *, unsigned

  long> >' required here

class SmallVectorImpl : public SmallVectorTemplateBase<T> {

  ^~~~~~~~~~~~~~~~~~~~~~~~~~

../include/llvm/ADT/SmallVector.h:845:28: note: in instantiation of template class 'llvm::SmallVectorImpl<std::pair<void *, unsigned long> >'

  requested here

class SmallVector : public SmallVectorImpl<T>, SmallVectorStorage<T, N> {

  ^

../include/llvm/Support/Allocator.h:373:45: note: in instantiation of template class 'llvm::SmallVector<std::pair<void *, unsigned long>, 0>'

      requested here
  SmallVector<std::pair<void *, size_t>, 0> CustomSizedSlabs;
                                            ^

../include/llvm/Support/type_traits.h:96:7: note: copy assignment operator of 'trivial_helper<std::pair<void *, unsigned long> >' is

    implicitly deleted because variant field 't' has a non-trivial copy assignment operator
  T t;
    ^


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57018





More information about the llvm-commits mailing list