Disable use of [[deprecated]] with gcc 5

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++ -
	<stdin>:1:1: error: expected unqualified-id before ‘[’ token

so disable its use with gcc < 6.
This commit is contained in:
Vadim Zeitlin
2021-07-11 15:02:41 +02:00
parent 7a8f2dffbd
commit f6da66debc

View File

@@ -585,9 +585,12 @@ typedef short int WXTYPE;
#if defined(__has_cpp_attribute) #if defined(__has_cpp_attribute)
#if __has_cpp_attribute(deprecated) #if __has_cpp_attribute(deprecated)
/* gcc 5 claims to support this attribute, but actually doesn't */
#if !defined(__GNUC__) || wxCHECK_GCC_VERSION(6, 0)
#define wxHAS_DEPRECATED_ATTR #define wxHAS_DEPRECATED_ATTR
#endif #endif
#endif #endif
#endif
/* The basic compiler-specific construct to generate a deprecation warning. */ /* The basic compiler-specific construct to generate a deprecation warning. */
#ifdef wxHAS_DEPRECATED_ATTR #ifdef wxHAS_DEPRECATED_ATTR