From 58d244edb7c9478e69055f825d89b855797dff2b Mon Sep 17 00:00:00 2001 From: Shane Grant Date: Thu, 30 Jun 2016 14:38:54 -0700 Subject: [PATCH] fix uninit valgrind error for base ctor in diamond inheritance --- unittests/polymorphic.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unittests/polymorphic.cpp b/unittests/polymorphic.cpp index db9d1630e..1cd47236a 100644 --- a/unittests/polymorphic.cpp +++ b/unittests/polymorphic.cpp @@ -102,7 +102,7 @@ struct PolyDerivedD : PolyBaseB, PolyBaseC { PolyDerivedD() {} PolyDerivedD( std::string const & zz, double yy, int xx, long ww ) : - PolyBaseB( xx, ww ), PolyBaseC( yy, ww ), z(zz) {} + PolyBaseAA( ww ), PolyBaseB( xx, ww ), PolyBaseC( yy, ww ), z(zz) {} std::string z; template @@ -258,6 +258,7 @@ void test_polymorphic() std::shared_ptr o_sharedA = std::make_shared( random_basic_string(gen), rngD(), rngI(), rngL() ); + std::weak_ptr o_weakA = o_sharedA; std::unique_ptr o_uniqueA( new PolyDerivedD( random_basic_string(gen), rngD(), rngI(), rngL() ) );