Package: cppcheck
Version: 1.27-2
Severity: wishlist

$ cat testcase.c++
#include <fstream>

class Foo {
                int foo;
        public:
                Foo(std::istream &in) { if(!(in >> foo)) throw 0; }
};
$ cppcheck testcase.c++
Checking testcase.c++: ...
[testcase.c++:6] Uninitialized member variable 'Foo::foo'
$

cppcheck classifies Foo::foo to be uninitialized although the class will
not produce an instance if a read into this variable fails.

I don't know whether it is feasible to fix this. If not feel free to tag
this bug report as wontfix.

Helmut



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to