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);