Repository: kudu Updated Branches: refs/heads/master 66b06de7b -> b8e329974
build: don't instantiate const objects with no user-defined constructor It seems that some compilers disallow instantiating const objects that don't provide a user-provided constructor. This would surface as the following error. error: default initialization of an object of const type 'const ClusterInfo' requires a user-provided default constructor Change-Id: Ia21baed51e035d9005453fd7d08274c9c23e74d7 Reviewed-on: http://gerrit.cloudera.org:8080/11971 Tested-by: Kudu Jenkins Reviewed-by: Alexey Serbin <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/307de65b Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/307de65b Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/307de65b Branch: refs/heads/master Commit: 307de65bd219bdad78dfc9f52e3638fbcd8cb730 Parents: 66b06de Author: Andrew Wong <[email protected]> Authored: Tue Nov 20 16:37:53 2018 -0800 Committer: Andrew Wong <[email protected]> Committed: Wed Nov 21 05:12:52 2018 +0000 ---------------------------------------------------------------------- src/kudu/tools/rebalance_algo-test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/307de65b/src/kudu/tools/rebalance_algo-test.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/rebalance_algo-test.cc b/src/kudu/tools/rebalance_algo-test.cc index 092ac4d..c8ba5c7 100644 --- a/src/kudu/tools/rebalance_algo-test.cc +++ b/src/kudu/tools/rebalance_algo-test.cc @@ -291,7 +291,7 @@ string TestClusterConfigToDebugString(const TestClusterConfig& cfg) { // Test the behavior of the algorithm when no input information is given. TEST(RebalanceAlgoUnitTest, EmptyClusterInfoGetNextMoves) { vector<TableReplicaMove> moves; - const ClusterInfo info; + const ClusterInfo info = {}; ASSERT_OK(TwoDimensionalGreedyAlgo().GetNextMoves(info, 0, &moves)); EXPECT_TRUE(moves.empty()); } @@ -321,7 +321,7 @@ TEST(RebalanceAlgoUnitTest, NoTableSkewInClusterBalanceInfoGetNextMoves) { // GetNextMove() when no input information is given. TEST(RebalanceAlgoUnitTest, EmptyBalanceInfoGetNextMove) { boost::optional<TableReplicaMove> move; - const ClusterInfo info; + const ClusterInfo info = {}; const auto s = TwoDimensionalGreedyAlgo().GetNextMove(info, &move); ASSERT_TRUE(s.IsInvalidArgument()) << s.ToString(); EXPECT_EQ(boost::none, move);
