@@ -149,6 +149,7 @@ class TestVarID : public TestFixture {
149149 TEST_CASE (varid_in_class26);
150150 TEST_CASE (varid_in_class27);
151151 TEST_CASE (varid_in_class28);
152+ TEST_CASE (varid_in_class29);
152153 TEST_CASE (varid_namespace_1); // #7272
153154 TEST_CASE (varid_namespace_2); // #7000
154155 TEST_CASE (varid_namespace_3); // #8627
@@ -2380,6 +2381,28 @@ class TestVarID : public TestFixture {
23802381 ASSERT_EQUALS (expected, tokenize (code));
23812382 }
23822383
2384+ void varid_in_class29 () {
2385+ const char code[] = " struct S {\n " // #14486
2386+ " const int& r;\n "
2387+ " explicit S(const int& r) : r(r) {}\n "
2388+ " static void f() {\n "
2389+ " struct T : std::vector<int> {\n "
2390+ " bool g() const { return empty(); }\n "
2391+ " };\n "
2392+ " }\n "
2393+ " };\n " ;
2394+ const char expected[] = " 1: struct S {\n "
2395+ " 2: const int & r@1 ;\n "
2396+ " 3: explicit S ( const int & r@2 ) : r@1 ( r@2 ) { }\n "
2397+ " 4: static void f ( ) {\n "
2398+ " 5: struct T : std :: vector < int > {\n "
2399+ " 6: bool g ( ) const { return empty ( ) ; }\n "
2400+ " 7: } ;\n "
2401+ " 8: }\n "
2402+ " 9: } ;\n " ;
2403+ ASSERT_EQUALS (expected, tokenize (code));
2404+ }
2405+
23832406 void varid_namespace_1 () { // #7272
23842407 const char code[] = " namespace Blah {\n "
23852408 " struct foo { int x;};\n "
0 commit comments