]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a test for an icc-13 bug throwing an internal compiler error when encountering
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 18 Jan 2013 15:37:18 +0000 (15:37 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 18 Jan 2013 15:37:18 +0000 (15:37 +0000)
std::numeric_limits<int>::max()

under very special conditions

git-svn-id: https://svn.dealii.org/branches/branch_cmake@28130 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/checks/check_02_compiler_bugs.cmake

index 767af796795523169748b40ec4dbd9cf0800f426..b06bd37220f5bd02f4e6882bff7862299ad37921 100644 (file)
@@ -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 <limits>
+  struct Integer
+  {
+    static const int min_int_value;
+    static const int max_int_value;
+  };
+  const int Integer::min_int_value = std::numeric_limits<int>::min();
+  const int Integer::max_int_value = std::numeric_limits<int>::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()
+

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.