diff --git a/rules/S3252/cfamily/rule.adoc b/rules/S3252/cfamily/rule.adoc index 2c8deee4d4..7781f02e30 100644 --- a/rules/S3252/cfamily/rule.adoc +++ b/rules/S3252/cfamily/rule.adoc @@ -4,7 +4,7 @@ In the interest of code clarity, ``++static++`` member variables of a base class === Noncompliant code example -[source,cpp] +[source,cpp,diff-id=1,diff-type=noncompliant] ---- class Parent { public: @@ -14,8 +14,7 @@ class Parent { class Child : public Parent { public: - Child() : myColor(Child::defaultColor) // Compliant, this is a constant - { + Child() : myColor(Child::defaultColor) { // Compliant: defaultColor is a constant Child::count++; // Noncompliant } }; @@ -23,7 +22,7 @@ class Child : public Parent { === Compliant solution -[source,cpp] +[source,cpp,diff-id=1,diff-type=compliant] ---- class Parent { public: @@ -33,8 +32,7 @@ class Parent { class Child : public Parent { public: - Child() : myColor(Child::defaultColor) // Compliant, this is a constant - { + Child() : myColor(Child::defaultColor) { // Compliant: defaultColor is a constant Parent::count++; } }; @@ -100,7 +98,7 @@ In this case it would be: === on 23 Jan 2016, 14:53:05 Ann Campbell wrote: -That's fine [~alban.auzeill]. +That's fine [~alban.auzeill]. include::../comments-and-links.adoc[]