From 55663153161f99caf4ba5b0bf95290ed6a2e106d Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 16 Nov 2022 18:57:05 +0000 Subject: [PATCH] Expand BOOST_ATTRIBUTE_UNUSED [[maybe_unused]] When available, supersedes: https://github.com/boostorg/config/pull/456 --- include/boost/config/detail/suffix.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/boost/config/detail/suffix.hpp b/include/boost/config/detail/suffix.hpp index 898c7ac4..0d451d1f 100644 --- a/include/boost/config/detail/suffix.hpp +++ b/include/boost/config/detail/suffix.hpp @@ -1071,9 +1071,22 @@ namespace std{ using ::type_info; } // // Unused variable/typedef workarounds: // +#ifndef BOOST_ATTRIBUTE_UNUSED +# if defined(__has_attribute) && defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x5130) +# if __has_attribute(maybe_unused) +# define BOOST_ATTRIBUTE_UNUSED [[maybe_unused]] +# endif +# elif defined(__has_cpp_attribute) +# if __has_cpp_attribute(maybe_unused) +# define BOOST_ATTRIBUTE_UNUSED [[maybe_unused]] +# endif +# endif +#endif + #ifndef BOOST_ATTRIBUTE_UNUSED # define BOOST_ATTRIBUTE_UNUSED #endif + // // [[nodiscard]]: //