From 51ba9f1b4568dd0c22bef3c9820da48f9d6a3731 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 24 Sep 2017 12:47:05 +0300 Subject: [PATCH] Add one more case to value_init_workaround_test --- test/value_init_workaround_test.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/test/value_init_workaround_test.cpp b/test/value_init_workaround_test.cpp index 10c9b4c..9ffdffc 100644 --- a/test/value_init_workaround_test.cpp +++ b/test/value_init_workaround_test.cpp @@ -75,6 +75,24 @@ namespace return true; } + struct int_pair_struct + { + int first; + int second; + }; + + typedef int int_pair_struct::*ptr_to_member_type; + + struct ptr_to_member_struct + { + ptr_to_member_type data; + }; + + bool is_value_initialized(const ptr_to_member_struct& arg) + { + return arg.data == 0; + } + template bool is_value_initialized(const T(& arg)[2]) { @@ -132,7 +150,8 @@ int main() const unsigned num_failures = FAILED_TO_VALUE_INITIALIZE(boost::value_initialized()) + FAILED_TO_VALUE_INITIALIZE(boost::value_initialized()) + - FAILED_TO_VALUE_INITIALIZE(boost::value_initialized()); + FAILED_TO_VALUE_INITIALIZE(boost::value_initialized()) + + FAILED_TO_VALUE_INITIALIZE(boost::value_initialized()); #ifdef BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED // One or more failures are expected.