CPP: Test exposing UseInOwnInitializer FPs.

This commit is contained in:
Geoffrey White
2019-07-22 10:02:48 +01:00
parent f12c057826
commit 185ca590f2
2 changed files with 27 additions and 0 deletions

View File

@@ -2,3 +2,7 @@
| 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

@@ -66,3 +66,26 @@ void test11() {
void test12() {
self_initialize(int, x); // GOOD (statement is from a macro)
}
namespace ns1
{
const int v2 = 1;
const int v4 = 1;
const int v6 = 1;
};
namespace ns2
{
const int v1 = ns1::v2; // GOOD
const int v2 = ns1::v2; // GOOD [FALSE POSITIVE; produces INVALID_KEY trap warning]
};
const int v3 = ns1::v4; // GOOD
const int v4 = ns1::v4; // GOOD [FALSE POSITIVE]
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
};