]> https://gitweb.dealii.org/ - dealii.git/commitdiff
improve check for CAN_CALL_NONCONSTEXPR 8759/head
authorTimo Heister <timo.heister@gmail.com>
Mon, 16 Sep 2019 13:25:29 +0000 (09:25 -0400)
committerTimo Heister <timo.heister@gmail.com>
Mon, 16 Sep 2019 13:26:20 +0000 (09:26 -0400)
On intel 19.0.5, the check
DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR passes but
compilation of an assert (and as such a throw call) fails.
Improve the test to catch this.
I can confirm that clang6 still passes this check as before.
fixes  #8758

cmake/checks/check_01_cxx_features.cmake

index e94d944885fa38e1de0b3dcd611ddd90d2cfa9e0..6eb67b2191d9851199130384fbe0e585ec2741c7 100644 (file)
@@ -733,12 +733,14 @@ CHECK_CXX_SOURCE_COMPILES(
 #
 CHECK_CXX_SOURCE_COMPILES(
   "
+  #define Assert(x,y) if (!(x)) throw y;
   void bar()
   {}
 
   constexpr int
   foo(const int n)
   {
+    Assert(n>0, \"hello\");
     if(!(n >= 0))
       bar();
     return n;

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.