@@ -176,6 +176,7 @@ class TestVarID : public TestFixture {
176176 TEST_CASE (varid_lambda_mutable);
177177 TEST_CASE (varid_trailing_return1); // #8889
178178 TEST_CASE (varid_trailing_return2); // #9066
179+ TEST_CASE (varid_trailing_return3); // #11423
179180 TEST_CASE (varid_parameter_pack); // #9383
180181 TEST_CASE (varid_for_auto_cpp17);
181182 TEST_CASE (varid_not); // #9689 'not x'
@@ -2822,6 +2823,18 @@ class TestVarID : public TestFixture {
28222823 ASSERT_EQUALS (exp1, tokenize (code1));
28232824 }
28242825
2826+ void varid_trailing_return3 () { // #11423
2827+ const char code[] = " void f(int a, int b) {\n "
2828+ " auto g = [](int& a, const int b) -> void {};\n "
2829+ " auto h = [&a, &b]() { std::swap(a, b); };\n "
2830+ " }\n " ;
2831+ const char exp[] = " 1: void f ( int a@1 , int b@2 ) {\n "
2832+ " 2: auto g@3 ; g@3 = [ ] ( int & a@4 , const int b@5 ) . void { } ;\n "
2833+ " 3: auto h@6 ; h@6 = [ & a@1 , & b@2 ] ( ) { std :: swap ( a@1 , b@2 ) ; } ;\n "
2834+ " 4: }\n " ;
2835+ ASSERT_EQUALS (exp, tokenize (code));
2836+ }
2837+
28252838 void varid_parameter_pack () { // #9383
28262839 const char code1[] = " template <typename... Rest>\n "
28272840 " void func(Rest... parameters) {\n "
0 commit comments