diff --git a/tests/nlopt.cpp b/tests/nlopt.cpp index 605baabf7..a16b733c1 100644 --- a/tests/nlopt.cpp +++ b/tests/nlopt.cpp @@ -385,7 +385,8 @@ BOOST_AUTO_TEST_CASE(nlopt_loc_opt) BOOST_AUTO_TEST_CASE(nlopt_initial_population_not_respecting_bounds_throw_test) { // We test that the algorithm throws if the initial population does not respect the bounds - auto pop = population{hs71{}, 1}; + auto prob = hs71{}; + auto pop = population{prob, 1}; auto a = nlopt{"slsqp"}; auto dv = pop.get_x()[0]; dv[0] = prob.get_bounds().first[0] - 1.;