(warning) Member variable 'X::y' is not initialized in the constructor.
No warning is issued for X::x at the same time.
If the commented line is uncommented, no warning is issued.
As far as I understand this, whenever a member variable is referenced in a call from ctor code, it's considered initialized by that code. (BTW this is true even if parse() takes its argument by value rather than by reference, which is ridiculous.) However the second element in the chained call to parse() appears to be ignored, which causes false positive for y.
Last edit: Alexey Biryukov 2017-02-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I should have posted that to trac but I still don't have confirmation email received.
cpp-check 1.77 issues a warning for that:
No warning is issued for X::x at the same time.
If the commented line is uncommented, no warning is issued.
As far as I understand this, whenever a member variable is referenced in a call from ctor code, it's considered initialized by that code. (BTW this is true even if parse() takes its argument by value rather than by reference, which is ridiculous.) However the second element in the chained call to parse() appears to be ignored, which causes false positive for y.
Last edit: Alexey Biryukov 2017-02-17
hi! sorry for late reply. please try the verification code 'Js6luWrz'.
yes that is not good.