...
Code Block | ||||
---|---|---|---|---|
| ||||
class C {
int a;
int b;
public:
C() : b(3), a(b+1) {}
};
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
class C {
int a;
int b;
public:
C() : a(b+1), b(3) {}
};
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
class C {
int a;
int b;
public:
C() : a(4), b(a-1) {}
};
|
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
OOP37-CPP | medium | probable | medium | P8 | L2 |
Automated Detection
Tool | Version | Checker | Description | ||||||
| 4053,4056,4058 |
Bibliography
[Lockheed Martin 05] AV Rule 75 Members of the initialization list shall be listed in the order in which they are declared in the class.
[ISO/IEC 14882-2003] Section 12.6.2 "Initializing bases and members"
...
OOP36-CPP. Do not assume that copy constructor invocations will not be elided 13013. Object Oriented Programming (OOP) 14014. Concurrency (CON)