From: Timo Heister Date: Mon, 23 Apr 2018 14:56:31 +0000 (-0400) Subject: harden cmake deprecation check X-Git-Tag: v9.0.0-rc1~138^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6293%2Fhead;p=dealii.git harden cmake deprecation check 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. --- diff --git a/cmake/checks/check_01_compiler_features.cmake b/cmake/checks/check_01_compiler_features.cmake index 9341c1afcc..b0e6fd7799 100644 --- a/cmake/checks/check_01_compiler_features.cmake +++ b/cmake/checks/check_01_compiler_features.cmake @@ -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