aboutsummaryrefslogtreecommitdiff
path: root/build2/variable
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-01-09 17:03:04 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-01-09 21:44:23 +0300
commitca97c1e1527e721cae3a1114864da2110b15406a (patch)
tree4db188edbc01e3ebcb74920e52cc6bf8b6846af8 /build2/variable
parent13fd92f4c8e4f68bf4f9cc0b7de95e7ee7fe9d82 (diff)
Workaround libc++'s basic_string<line_char> crash
Diffstat (limited to 'build2/variable')
-rw-r--r--build2/variable11
1 files changed, 7 insertions, 4 deletions
diff --git a/build2/variable b/build2/variable
index 6aec85b..2206fe0 100644
--- a/build2/variable
+++ b/build2/variable
@@ -232,11 +232,14 @@ namespace build2
// specialization below). Types that don't fit will have to be handled
// with an extra dynamic allocation.
//
- std::aligned_storage<sizeof (string) * 11>::type data_;
-
- // VC14 needs decltype.
+ // std::max() is not constexpr on GCC 4.9.
//
- static const size_t size_ = sizeof (decltype (data_));
+ static constexpr size_t size_ =
+ sizeof (names) > sizeof (target_triplet)
+ ? sizeof (names)
+ : sizeof (target_triplet);
+
+ std::aligned_storage<size_>::type data_;
// Make sure we have sufficient storage for untyped values.
//