Stop ICC ICE
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 26 Sep 2018 10:25:13 +0000 (12:25 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Sat, 29 Sep 2018 14:16:15 +0000 (16:16 +0200)
Fixes #2648

Change-Id: I52929b347b5a5b4fa44b63b2e9397f581e03d3c3

src/gromacs/compat/pointers.h

index eb565e7f3231b5c01c9834a73d84c5eef81b5f62..53955d26d832726c07cf97752c79c96960944d9f 100644 (file)
@@ -61,8 +61,16 @@ namespace compat
 
 //! Contract-assurance macros that work like a simple version of the GSL ones
 //! \{
-#define Expects(cond) GMX_ASSERT(cond, "Precondition violation")
-#define Ensures(cond) GMX_ASSERT(cond, "Postcondition violation")
+#ifndef __INTEL_COMPILER
+#define Expects(cond) GMX_ASSERT((cond), "Precondition violation")
+#define Ensures(cond) GMX_ASSERT((cond), "Postcondition violation")
+#else
+// icc 18.0.0 in a RelWithAssert build has an ICE, even if we directly
+// embed the contents of GMX_ASSERT, so it seems the lambda in
+// GMX_ASSERT is too complex for it in this use case.
+#define Expects(cond)
+#define Ensures(cond)
+#endif
 //! \}
 
 /*! \libinternal