From 10be38ef531809f119a90ba23216bf9511b47b08 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 5 May 2018 22:46:51 -0400 Subject: [PATCH] Check for constexpr std::max with C++14. --- cmake/checks/check_01_cxx_features.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmake/checks/check_01_cxx_features.cmake b/cmake/checks/check_01_cxx_features.cmake index 36e231d970..ccc50ab2f3 100644 --- a/cmake/checks/check_01_cxx_features.cmake +++ b/cmake/checks/check_01_cxx_features.cmake @@ -169,16 +169,19 @@ IF(NOT DEFINED DEAL_II_WITH_CXX14 OR DEAL_II_WITH_CXX14) PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}") # - # This test does not guarantee full C++14 support, but virtually every - # compiler with some C++14 support implements this. + # We assume std::max has a constexpr version and make_unique works # CHECK_CXX_SOURCE_COMPILES( " #include + #include + int main() { - auto ptr = std::make_unique(42); - return 0; + auto ptr = std::make_unique(42); + constexpr int bob = std::max(sizeof(ptr), sizeof(char[8])); + int bobs[bob]; + return 0; } " DEAL_II_HAVE_CXX14_MAKE_UNIQUE) -- 2.39.5