From 3fec2b7ec2febbe5032a9adc1bad53627a902052 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 12 Sep 2026 22:36:30 +0300 Subject: [PATCH] Disable the use of [[msvc::no_unique_address]] on versions prior to 1943, because it causes a warning in C++14 and C++17 mode. Refs #499. --- include/boost/config/compiler/visualc.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index a4519f87d..b994708f0 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -273,8 +273,10 @@ #define BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS #endif -#if _MSC_FULL_VER >= 192829913 -// Works with /std:c++14 and /std:c++17, and performs optimization +#if _MSC_VER >= 1943 +// Even though [[msvc::no_unique_address]] works on earlier versions, +// it issues a warning with /std:c++14 and /std:c++17, which is a problem +// https://github.com/boostorg/config/issues/499 #define BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]] #endif