Rehearse
Rehearse copied to clipboard
Drop infinitely recursive assignment operators
CelBoolVar and CelNumVar had incorrect implementationsfor their assignment operators.
For example compiling with clang 3.9 and -Winfinite-recursion turned on you get:
CelNumVar.cpp:47:56: warning: all paths through this function will call itself [-Winfinite-recursion]
CelNumVar& CelNumVar::operator= (const CelNumVar other){
...
CelBoolVar.cpp:17:59: warning: all paths through this function will call itself [-Winfinite-recursion]
CelBoolVar& CelBoolVar::operator= (const CelBoolVar other){
This PR drops the broken assignment operators. As they lead to infinite recursion we can be sure they were never actually called anywhere. However they still are instantiated in the tests so we have to change the CelExpression definition to accept a const argument to make things compile again. While the tests still run I can't say I'm comfortable with casting away the constness there but as I don't know Rehearse very well it was the most minimal change I could make to get it to build and test. The way the inheritance structure handles operators and copying looks like it would be worth reviewing as it feels like it could enable you to produce some unexpected results.
That's interesting. I need to look deeply and think about this, as you mentioned the code may need a deeper change.
Thank you very much.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.