From 015247ccd0fa70b84199715f72e8a7e37ed62209 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 25 Aug 2023 18:54:49 +0100 Subject: [PATCH] Add msvc support for [[maybe_unused]] attribute. Fixes: https://github.com/boostorg/serialization/issues/271 Also removes failing cuda+clang test as it's an inscrutable system setup issue. --- .github/workflows/ci.yml | 3 --- include/boost/config/compiler/visualc.hpp | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5ee02fd..f18362f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -570,9 +570,6 @@ jobs: - name: Config_test nvcc+clang run: nvcc -std=c++${{ matrix.std }} --compiler-bindir=clang++ -o config_test -I../../.. config_test.cpp -latomic && ./config_test working-directory: ../boost-root/libs/config/test - - name: Config_test nvcc-cuda+clang - run: nvcc -c -std=c++${{ matrix.std }} --compiler-bindir=clang++ -I../../.. config_test.cu - working-directory: ../boost-root/libs/config/test - name: Config_test clang-cuda run: clang++ -nocudalib --no-cuda-version-check -c --cuda-gpu-arch=sm_75 -std=c++${{ matrix.std }} -I../../.. config_test.cu working-directory: ../boost-root/libs/config/test diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index ae631219..c0ada098 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -305,6 +305,10 @@ # define BOOST_CXX_VERSION 201402L #endif +#if BOOST_CXX_VERSION >= 201703L +# define BOOST_ATTRIBUTE_UNUSED [[maybe_unused]] +#endif + #ifndef BOOST_COMPILER // TODO: // these things are mostly bogus. 1200 means version 12.0 of the compiler. The