[Support] Fix llvm::unique_function when building with GCC 4.9 by
authorChandler Carruth <chandlerc@gmail.com>
Tue, 3 Jul 2018 01:18:21 +0000 (01:18 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 3 Jul 2018 01:18:21 +0000 (01:18 +0000)
commitf814ad8932ef070ae901677299beecb4410e1b53
treecc86a5792708a8eb8370899419cfe403f9048d00
parentf8182f1aef5b6ec74cbe2c1618e759f0113921ba
[Support] Fix llvm::unique_function when building with GCC 4.9 by
introducing llvm::trivially_{copy,move}_constructible type traits.

This uses a completely portable implementation of these traits provided
by Richard Smith. You can see it on compiler explorer in all its glory:

  https://godbolt.org/g/QEDZjW

I have transcribed it, clang-formatted it, added some comments, and made
the tests fit into a unittest file.

I have also switched llvm::unique_function over to use these new, much
more portable traits. =D

Hopefully this will fix the build bot breakage from my prior commit.

llvm-svn: 336161
llvm/include/llvm/ADT/FunctionExtras.h
llvm/include/llvm/Support/type_traits.h
llvm/unittests/Support/CMakeLists.txt
llvm/unittests/Support/TypeTraitsTest.cpp [new file with mode: 0644]