I was performing a major re-write of some code and ran into one of those situations where looking at the code did not did not convey anything was wrong with it.
The former code had a class that contained pointers to some objects, and the ctor of that class nulled out the pointers.
fee = NULL;
fi = NULL;
fo = NULL;
Where NULL is promoted to pointer of any type.
In the rewrite of the code the pointers were replaced with the class objects using same names in the code.
However, a programming error on my part, I left the former pointer NULL-ing code in the ctor.
The compiler did not produce an error, I do not know if it should or should not, but the result was:
The compiler promoted the NULL to the class object,
peformed a default copy operator,
then destroyed the NULL class object.
Is this a feature or bug???