rspec/rules/S1245/rule.adoc
2021-02-02 16:54:43 +01:00

19 lines
337 B
Plaintext

----
int a;
class A
{
public:
A();
private:
int _b;
};
A::A()
{
_b=a; //Noncompliant
}
----
The order of initialization of static objects defined in different compilation units is not defined in the {cpp} language definition. Therefore, accessing global data from a constructor may result in reading from uninitialized objects