From acbeaae1815f1db8e7213f21144d66de69d0182c Mon Sep 17 00:00:00 2001 From: Braden Ganetsky Date: Thu, 27 Jun 2024 12:43:01 -0500 Subject: [PATCH] Add link to Visual Studio bug report --- include/boost/core/empty_value.hpp | 2 ++ test/empty_value_test.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/boost/core/empty_value.hpp b/include/boost/core/empty_value.hpp index ee86810..bb95841 100644 --- a/include/boost/core/empty_value.hpp +++ b/include/boost/core/empty_value.hpp @@ -96,6 +96,8 @@ private: #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) #if defined(BOOST_MSVC) +// This is a workaround to an MSVC bug when T is a nested class. +// See https://developercommunity.visualstudio.com/t/Compiler-bug:-Incorrect-C2247-and-C2248/10690025 namespace detail { template diff --git a/test/empty_value_test.cpp b/test/empty_value_test.cpp index fc03729..44dba4c 100644 --- a/test/empty_value_test.cpp +++ b/test/empty_value_test.cpp @@ -79,6 +79,9 @@ struct outer { void test_derived_compile() { + // This is testing the workaround to an MSVC bug when T is a nested class. + // See https://developercommunity.visualstudio.com/t/Compiler-bug:-Incorrect-C2247-and-C2248/10690025 + const boost::empty_value x1(boost::empty_init); const boost::empty_value x2(boost::empty_init); const boost::empty_value x3(boost::empty_init);