mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
CPP: Test exposing UseInOwnInitializer FPs.
This commit is contained in:
@@ -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. |
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user