]> https://gitweb.dealii.org/ - dealii.git/commitdiff
harden cmake deprecation check 6293/head
authorTimo Heister <timo.heister@gmail.com>
Mon, 23 Apr 2018 14:56:31 +0000 (10:56 -0400)
committerTimo Heister <timo.heister@gmail.com>
Mon, 23 Apr 2018 14:56:31 +0000 (10:56 -0400)
It turns out MSVC 2015 passes the CXX14 check for the deprecated
attribute, but then complains when it is used in a constructor:
E:\jenkins\workspace\workspace\dealii-windows-
compile\CC\msvc2015\label\win\include\deal.II/base/table_indices.h(129):
error C2416: attribute 'deprecated' cannot be applied in this context

Fix this.

cmake/checks/check_01_compiler_features.cmake

index 9341c1afcc1612b4819d4e8905dee6e56c45daf5..b0e6fd779952540e56c02d1c4c86a3416e7caf96 100644 (file)
@@ -322,6 +322,12 @@ CHECK_CXX_SOURCE_COMPILES(
           int old_fn () { return 0; }
           int (*fn_ptr)() = old_fn;
 
+          struct [[deprecated]] bob
+          {
+            [[deprecated]] bob(int i);
+            [[deprecated]] void test();
+          };
+
           int main () {}
   "
   DEAL_II_COMPILER_HAS_CXX14_ATTRIBUTE_DEPRECATED
@@ -333,6 +339,12 @@ CHECK_CXX_SOURCE_COMPILES(
           int old_fn () { return 0; }
           int (*fn_ptr)() = old_fn;
 
+          struct __attribute__((deprecated)) bob
+          {
+            __attribute__((deprecated)) bob(int i);
+            __attribute__((deprecated)) void test();
+          };
+
           int main () {}
   "
   DEAL_II_COMPILER_HAS_ATTRIBUTE_DEPRECATED

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.