CPP: Workaround FPs.

This commit is contained in:
Geoffrey White
2019-07-22 10:02:48 +01:00
parent 185ca590f2
commit d39d9bf1f0
3 changed files with 5 additions and 8 deletions

View File

@@ -2,7 +2,3 @@
| test.cpp:8:10:8:10 | x | x is used in its own initializer. |
| test.cpp:57:10:57:10 | x | x is used in its own initializer. |
| test.cpp:61:24:61:24 | x | x is used in its own initializer. |
| test.cpp:80:17:80:23 | v2 | v2 is used in its own initializer. |
| test.cpp:84:16:84:22 | v4 | v4 is used in its own initializer. |
| test.cpp:89:17:89:23 | v6 | v6 is used in its own initializer. |
| test.cpp:90:17:90:23 | v7 | v7 is used in its own initializer. |

View File

@@ -77,15 +77,15 @@ namespace ns1
namespace ns2
{
const int v1 = ns1::v2; // GOOD
const int v2 = ns1::v2; // GOOD [FALSE POSITIVE; produces INVALID_KEY trap warning]
const int v2 = ns1::v2; // GOOD [produces INVALID_KEY trap warning]
};
const int v3 = ns1::v4; // GOOD
const int v4 = ns1::v4; // GOOD [FALSE POSITIVE]
const int v4 = ns1::v4; // GOOD
namespace ns3
{
const int v5 = ns1::v6 + 1; // GOOD
const int v6 = ns1::v6 + 1; // GOOD [FALSE POSITIVE; produces INVALID_KEY trap warning]
const int v7 = ns3::v7; // BAD
const int v6 = ns1::v6 + 1; // GOOD [produces INVALID_KEY trap warning]
const int v7 = ns3::v7; // BAD [NOT DETECTED]
};