Skip to content

Commit bb5379d

Browse files
committed
add test
1 parent b702ead commit bb5379d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/testvarid.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class TestVarID : public TestFixture {
102102
TEST_CASE(varid70); // #12660 - function
103103
TEST_CASE(varid71); // #12676 - wrong varid in uninstantiated templated constructor
104104
TEST_CASE(varid72);
105+
TEST_CASE(varid73);
105106
TEST_CASE(varid_for_1);
106107
TEST_CASE(varid_for_2);
107108
TEST_CASE(varid_for_3);
@@ -1409,6 +1410,14 @@ class TestVarID : public TestFixture {
14091410
ASSERT_EQUALS(expected1, tokenize(code1));
14101411
}
14111412

1413+
void varid73() {
1414+
const char code[] = "namespace a { int x; };\n"
1415+
"namespace b { int x = a::x; };\n";
1416+
const char expected[] = "1: namespace a { int x@1 ; } ;\n"
1417+
"2: namespace b { int x@2 ; x@2 = a :: x@1 ; } ;\n";
1418+
ASSERT_EQUALS(expected, tokenize(code));
1419+
}
1420+
14121421
void varid_for_1() {
14131422
const char code[] = "void foo(int a, int b) {\n"
14141423
" for (int a=1,b=2;;) {}\n"

0 commit comments

Comments
 (0)