Skip to content

Commit

Permalink
More deprecated warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Oct 15, 2024
1 parent 69e2269 commit 003e743
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ql/cashflows/subperiodcoupon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ namespace QuantLib {
}


QL_DEPRECATED_DISABLE_WARNING

SubPeriodsLeg::SubPeriodsLeg(Schedule schedule, ext::shared_ptr<IborIndex> i)
: schedule_(std::move(schedule)), index_(std::move(i)), paymentCalendar_(schedule_.calendar()) {
QL_REQUIRE(index_, "no index provided");
Expand Down Expand Up @@ -474,14 +476,12 @@ namespace QuantLib {
paymentDate, -exCouponPeriod_, exCouponAdjustment_, exCouponEndOfMonth_);
}
}
QL_DEPRECATED_DISABLE_WARNING
cashflows.push_back(ext::shared_ptr<CashFlow>(new SubPeriodsCoupon(
paymentDate, detail::get(notionals_, i, notionals_.back()), start, end,
detail::get(fixingDays_, i, index_->fixingDays()), index_,
detail::get(gearings_, i, 1.0), detail::get(couponSpreads_, i, 0.0),
detail::get(rateSpreads_, i, 0.0), refStart, refEnd, paymentDayCounter_,
exCouponDate)));
QL_DEPRECATED_ENABLE_WARNING
}

switch (averagingMethod_) {
Expand All @@ -499,4 +499,6 @@ namespace QuantLib {
return cashflows;
}

QL_DEPRECATED_ENABLE_WARNING

}
10 changes: 9 additions & 1 deletion ql/instruments/zerocouponswap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ namespace QuantLib {
const Date& maturityDate,
Real nominal,
const ext::shared_ptr<IborIndex>& index) {
Schedule schedule = MakeSchedule()
.from(startDate)
.to(maturityDate)
.withTenor(index->tenor())
.withCalendar(index->fixingCalendar())
.withConvention(index->businessDayConvention())
.backwards()
.endOfMonth(index->endOfMonth());
auto floatCpn = ext::make_shared<SubPeriodsCoupon>(
paymentDate, nominal, startDate, maturityDate, index->fixingDays(), index);
paymentDate, nominal, schedule, index->fixingDays(), index);
floatCpn->setPricer(
ext::shared_ptr<FloatingRateCouponPricer>(new CompoundingRatePricer));
return floatCpn;
Expand Down
3 changes: 3 additions & 0 deletions test-suite/subperiodcoupons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ BOOST_AUTO_TEST_CASE(testSubPeriodsLegConsistencyChecks) {
Date start(18, March, 2021);
Date end(18, March, 2031);

QL_DEPRECATED_DISABLE_WARNING

Leg validLeg = vars.createSubPeriodsLeg(start, end);
Size N = validLeg.size();

Expand Down Expand Up @@ -326,6 +328,7 @@ BOOST_AUTO_TEST_CASE(testSubPeriodsLegConsistencyChecks) {
.withRateSpreads(std::vector<Spread>(N + 1, 0.0))),
Error);

QL_DEPRECATED_ENABLE_WARNING
}


Expand Down

0 comments on commit 003e743

Please sign in to comment.