diff options
author | Amanda Hamblin-Trué <amanda.hamblin-true@qt.io> | 2023-06-19 17:26:22 +0200 |
---|---|---|
committer | Amanda Hamblin-Trué <amanda.hamblin-true@qt.io> | 2023-06-26 12:16:25 +0200 |
commit | ce39beea0cd49bb93b0e345194265dd8081094cd (patch) | |
tree | f679c6ff13dfe0430c3885217d1d2782909fdfd9 /examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp | |
parent | 9f11a038b5294b27a98fc106183053535d6061dd (diff) |
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
Pick-to: 6.6 6.5
Change-Id: I007cd243055237bcc21772a4130a6c1a44fd882d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp')
-rw-r--r-- | examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp b/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp index a52b68f85b..8b8321859b 100644 --- a/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp +++ b/examples/corelib/bindableproperties/bindablesubscription/bindablesubscription.cpp @@ -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 |