Provide storage for `true_type::value` and `false_type::value`.
authorDan Liew <dan@su-root.co.uk>
Fri, 11 Jan 2019 17:59:52 +0000 (17:59 +0000)
committerDan Liew <dan@su-root.co.uk>
Fri, 11 Jan 2019 17:59:52 +0000 (17:59 +0000)
commitcb09a6f20c233ab1c446f4ba4e7345a1d13c9a17
tree6a168d096d6ea1aa349c64ac6e60f467f0a76173
parentee10ef737e58409d1c34c68ad17b568e8a50120f
Provide storage for `true_type::value` and `false_type::value`.

Summary:
This fixes linker errors that occurs when the
`sanitizer_type_traits_test.cc` is built without optimizations.

The error occurs because the test tries to take a reference.
A possible workaround is to give the GTest macros take boolean rvalues
by doing something like:

```
ASSERT_TRUE(bool(is_same<uptr, uptr>::value));
```

However this only hides the problem. Unfortunately Using `constexpr`
won't fix the problem unless we are using C++17.

Reviewers: vitalybuka, kubamracek, george.karpenkov, yln

Subscribers: mgorny, #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D56035

llvm-svn: 350940
compiler-rt/lib/sanitizer_common/CMakeLists.txt
compiler-rt/lib/sanitizer_common/sanitizer_type_traits.cc [new file with mode: 0644]