From eb2c94fcfca2317eb234b97083a2efc0f15ce90f Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Mon, 23 Apr 2018 10:56:31 -0400 Subject: [PATCH] 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. --- cmake/checks/check_01_compiler_features.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- 2.39.5