Revamp Bindable Properties Example

The use of Q_ASSERT(false) is bogus as we don't need to test here, but
want to signal unreachability.
Q_UNREACHABLE_RETURN allows us to tell the compiler that the point
can't be reached while also getting rid of the no return error.

Task-number: QTBUG-114689
Change-Id: I007cd243055237bcc21772a4130a6c1a44fd882d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit ce39beea0cd49bb93b0e345194265dd8081094cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Amanda Hamblin-Trué 2023-06-19 17:26:22 +02:00 committed by Qt Cherry-pick Bot
parent c85aa4947a
commit 6e395ef151

View File

@ -38,8 +38,7 @@ double BindableSubscription::calculateDiscount() const
case Yearly:
return 0.6;
}
Q_ASSERT(false);
return -1;
Q_UNREACHABLE_RETURN(-1);
}
int BindableSubscription::basePrice() const