diff --git a/ql/instruments/bonds/cpibond.cpp b/ql/instruments/bonds/cpibond.cpp index ccc7a36c05f..4d1df4c0ad2 100644 --- a/ql/instruments/bonds/cpibond.cpp +++ b/ql/instruments/bonds/cpibond.cpp @@ -55,7 +55,7 @@ namespace QuantLib { paymentCalendar == Calendar() ? schedule.calendar() : paymentCalendar, issueDate), frequency_(schedule.tenor().frequency()), dayCounter_(accrualDayCounter), - growthOnly_(false), baseCPI_(baseCPI), observationLag_(observationLag), + baseCPI_(baseCPI), observationLag_(observationLag), cpiIndex_(std::move(cpiIndex)), observationInterpolation_(observationInterpolation) { maturityDate_ = schedule.endDate(); diff --git a/ql/instruments/bonds/cpibond.hpp b/ql/instruments/bonds/cpibond.hpp index 94c190452c9..dc9a3029811 100644 --- a/ql/instruments/bonds/cpibond.hpp +++ b/ql/instruments/bonds/cpibond.hpp @@ -86,7 +86,7 @@ namespace QuantLib { Deprecated in version 1.45. */ [[deprecated("Do not use; meaningless for a bond.")]] - bool growthOnly_; + bool growthOnly_ = false; Real baseCPI_; Period observationLag_; ext::shared_ptr cpiIndex_; diff --git a/ql/models/model.cpp b/ql/models/model.cpp index cafb2fe6b81..24cbd5f34a6 100644 --- a/ql/models/model.cpp +++ b/ql/models/model.cpp @@ -136,7 +136,7 @@ namespace QuantLib { } void CalibratedModel::setParams(const Array& params) { - auto p = params.begin(); + const auto *p = params.begin(); for (auto& argument : arguments_) { for (Size j = 0; j < argument.size(); ++j, ++p) { QL_REQUIRE(p!=params.end(),"parameter array too small"); diff --git a/ql/models/shortrate/onefactormodels/markovfunctional.hpp b/ql/models/shortrate/onefactormodels/markovfunctional.hpp index 75df2b04443..416eba33f08 100644 --- a/ql/models/shortrate/onefactormodels/markovfunctional.hpp +++ b/ql/models/shortrate/onefactormodels/markovfunctional.hpp @@ -159,9 +159,9 @@ namespace QuantLib { addAdjustment(KahaleInterpolation); } - const int smileTreatments = ((adjustments_ & KahaleSmile) != 0) + - ((adjustments_ & SabrSmile) != 0) + - ((adjustments_ & CustomSmile) != 0); + const int smileTreatments = static_cast((adjustments_ & KahaleSmile) != 0) + + static_cast((adjustments_ & SabrSmile) != 0) + + static_cast((adjustments_ & CustomSmile) != 0); QL_REQUIRE(smileTreatments <= 1, "At most one of KahaleSmile, SabrSmile and CustomSmile " "can be specified at the same time"); diff --git a/ql/pricingengines/swaption/gaussian1dfloatfloatswaptionengine.cpp b/ql/pricingengines/swaption/gaussian1dfloatfloatswaptionengine.cpp index d75e6296d44..45b0e2af984 100644 --- a/ql/pricingengines/swaption/gaussian1dfloatfloatswaptionengine.cpp +++ b/ql/pricingengines/swaption/gaussian1dfloatfloatswaptionengine.cpp @@ -239,9 +239,9 @@ namespace QuantLib { if (considerProbabilities && probabilities_ != None && event1Time != Null()) { probabilityPayoffs.reserve(npvp1.size()); - for (Size m = 0; m < npvp1.size(); ++m) { + for (auto & m : npvp1) { probabilityPayoffs.emplace_back( - z.begin(), z.end(), npvp1[m].begin(), + z.begin(), z.end(), m.begin(), CubicInterpolation::Spline, true, CubicInterpolation::Lagrange, 0.0, CubicInterpolation::Lagrange, 0.0); diff --git a/test-suite/dates.cpp b/test-suite/dates.cpp index d265745dcad..098fb8929d8 100644 --- a/test-suite/dates.cpp +++ b/test-suite/dates.cpp @@ -552,7 +552,7 @@ BOOST_AUTO_TEST_CASE(nullDate) { Date null_date = Date(); - static_assert(std::is_nothrow_default_constructible::value, + static_assert(std::is_nothrow_default_constructible_v, "Date default construction must be noexcept"); BOOST_CHECK_EQUAL(null_date.serialNumber(), 0);