From ca97c1e1527e721cae3a1114864da2110b15406a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 9 Jan 2017 17:03:04 +0300 Subject: Workaround libc++'s basic_string crash --- build2/variable | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'build2/variable') 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::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::type data_; // Make sure we have sufficient storage for untyped values. // -- cgit v1.1