From f6da66debc9745800725f001af9700ff4e7751aa Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 11 Jul 2021 15:02:41 +0200 Subject: [PATCH] Disable use of [[deprecated]] with gcc 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This gcc version claims support for this attribute, but actually doesn't support it and returns unclear errors when it is used, e.g. $ echo '[[deprecated]] int x;' | g++-5 -fsyntax-only -x c++ - :1:1: error: expected unqualified-id before ‘[’ token so disable its use with gcc < 6. --- include/wx/defs.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 9a063416ed..a7f3a594da 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -585,7 +585,10 @@ typedef short int WXTYPE; #if defined(__has_cpp_attribute) #if __has_cpp_attribute(deprecated) - #define wxHAS_DEPRECATED_ATTR + /* gcc 5 claims to support this attribute, but actually doesn't */ + #if !defined(__GNUC__) || wxCHECK_GCC_VERSION(6, 0) + #define wxHAS_DEPRECATED_ATTR + #endif #endif #endif