Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#FFcccc
langcpp

class C {
  int a;
  int b;
public:
  C() : b(3), a(b+1) {}
};

...

Code Block
bgColor#FFcccc
langcpp

class C {
  int a;
  int b;
public:
  C() : a(b+1), b(3) {}
};

...

Code Block
bgColor#ccccff
langcpp

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

 PRQA QA-C++

 
Include Page
PRQA QA-C++_v
PRQA QA-C++_v

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)