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>
This commit is contained in:
parent
9f11a038b5
commit
ce39beea0c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user