From: maier Date: Fri, 18 Jan 2013 15:37:18 +0000 (+0000) Subject: Add a test for an icc-13 bug throwing an internal compiler error when encountering X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c5a06328a1c0545f88e2b9dbd139b25534ad48e;p=dealii-svn.git Add a test for an icc-13 bug throwing an internal compiler error when encountering std::numeric_limits::max() under very special conditions git-svn-id: https://svn.dealii.org/branches/branch_cmake@28130 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/cmake/checks/check_02_compiler_bugs.cmake b/deal.II/cmake/checks/check_02_compiler_bugs.cmake index 767af79679..b06bd37220 100644 --- a/deal.II/cmake/checks/check_02_compiler_bugs.cmake +++ b/deal.II/cmake/checks/check_02_compiler_bugs.cmake @@ -358,3 +358,37 @@ IF(DEAL_II_HAVE_BUNDLED_DIRECTORY) ENDIF() +# +# icc-13 triggers an internal compiler error when compiling +# std::numeric_limits<...>::min() with -std=c++0x [1]. +# Just disable C++11 support completely in this case. +# +# Reported by Ted Kord. +# +# - Matthias Maier, 2013 +# +# [1] http://software.intel.com/en-us/forums/topic/328902 +# +CHECK_CXX_COMPILER_BUG( + " + #include + struct Integer + { + static const int min_int_value; + static const int max_int_value; + }; + const int Integer::min_int_value = std::numeric_limits::min(); + const int Integer::max_int_value = std::numeric_limits::max(); + int main() { return 0; } + " + DEAL_II_ICC_NUMERICLIMITS_BUG) + +IF(DEAL_II_ICC_NUMERICLIMITS_BUG) + MESSAGE(STATUS + "DEAL_II_ICC_NUMERICLIMITS_BUG found, disabling c++11 support" + ) + STRIP_FLAG(CMAKE_CXX_FLAGS "${DEAL_II_CXX11_FLAG}") + SET(DEAL_II_CAN_USE_CXX1X FALSE) + SET(DEAL_II_CAN_USE_CXX11 FALSE) +ENDIF() +