Merge pull request #1615 from geoffw0/exprowninit

CPP: Test + workaround for UseInOwnInitializer.ql
This commit is contained in:
Robert Marsh
2019-07-24 12:13:24 -07:00
committed by GitHub
3 changed files with 25 additions and 0 deletions

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 [produces INVALID_KEY trap warning]
};
const int v3 = ns1::v4; // GOOD
const int v4 = ns1::v4; // GOOD
namespace ns3
{
const int v5 = ns1::v6 + 1; // GOOD
const int v6 = ns1::v6 + 1; // GOOD [produces INVALID_KEY trap warning]
const int v7 = ns3::v7; // BAD [NOT DETECTED]
};