From: David Wells Date: Sun, 6 May 2018 02:46:51 +0000 (-0400) Subject: Check for constexpr std::max with C++14. X-Git-Tag: v9.1.0-rc1~1208^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10be38ef531809f119a90ba23216bf9511b47b08;p=dealii.git Check for constexpr std::max with C++14. --- 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)