...
Code Block | ||||
---|---|---|---|---|
| ||||
// a.cpp struct S { int a; }; // b.cpp class S { public: int a; }; |
Compliant Solution
The compliant solution correct mitigation depends on programmer intent. If the programmer intends for the same class definition to be visible in both translation units because of common usage, the solution is to use a header file to introduce the object into both translation units, as shown in this compliant solution:
...