diff --git a/test/empty_value_test.cpp b/test/empty_value_test.cpp index b7cf796..fc03729 100644 --- a/test/empty_value_test.cpp +++ b/test/empty_value_test.cpp @@ -63,6 +63,37 @@ void test_type() BOOST_TEST(v2.get().value() == 6); } +template +struct derived : boost::empty_value { + typedef typename boost::empty_value::type type; + derived(boost::empty_init_t e) : boost::empty_value(e) {} +}; + +struct outer { + struct inner_empty {}; + struct inner_non_empty { + inner_non_empty() : value() {} + int value; + }; +}; + +void test_derived_compile() +{ + const boost::empty_value x1(boost::empty_init); + const boost::empty_value x2(boost::empty_init); + const boost::empty_value x3(boost::empty_init); + const derived x4(boost::empty_init); + const derived x5(boost::empty_init); + const derived x6(boost::empty_init); + + (void)x1; + (void)x2; + (void)x3; + (void)x4; + (void)x5; + (void)x6; +} + int main() { test_int();