This code will still work.
You do not (currently) break the promise of not to modify the local var.
Boolean is passed by value. And it is highly unlikely that a platform will ever exist, for which this will not be the case. (e.g. a platform where "sizeof(boolean) > sizeof(pointer)")
Besides:
not FAdvancedSearch
is an expression, you are passing the result of the expression, not the variable.
So even if bool was passed by ref, it would still work.
But you do have a point, it is easy to get to a point where you break the promise not to chane the parameter.