@@ -248,6 +248,7 @@ class TestVarID : public TestFixture {
248248 TEST_CASE (exprid8);
249249 TEST_CASE (exprid9);
250250 TEST_CASE (exprid10);
251+ TEST_CASE (exprid11);
251252
252253 TEST_CASE (structuredBindings);
253254 }
@@ -4169,6 +4170,26 @@ class TestVarID : public TestFixture {
41694170 ASSERT_EQUALS (expected, tokenizeExpr (code));
41704171 }
41714172
4173+ void exprid11 ()
4174+ {
4175+ const char * code{}, *exp{};
4176+ code = " struct S { void f(); };\n " // #12713
4177+ " int g(int, S*);\n "
4178+ " int h(void (*)(), S*);\n "
4179+ " void S::f() {\n "
4180+ " std::make_unique<int>(g({}, this)).release();\n "
4181+ " std::make_unique<int>(h([]() {}, this)).release();\n "
4182+ " }\n " ;
4183+ exp = " 1: struct S { void f ( ) ; } ;\n "
4184+ " 2: int g ( int , S * ) ;\n "
4185+ " 3: int h ( void ( * ) ( ) , S * ) ;\n "
4186+ " 4: void S :: f ( ) {\n "
4187+ " 5: std ::@UNIQUE make_unique < int > (@UNIQUE g (@UNIQUE { } ,@6 this ) ) .@UNIQUE release (@UNIQUE ) ;\n "
4188+ " 6: std ::@UNIQUE make_unique < int > (@UNIQUE h (@UNIQUE [ ] ( ) { } ,@6 this ) ) .@UNIQUE release (@UNIQUE ) ;\n "
4189+ " 7: }\n " ;
4190+ ASSERT_EQUALS (exp, tokenizeExpr (code));
4191+ }
4192+
41724193 void structuredBindings () {
41734194 const char code[] = " int foo() { auto [x,y] = xy(); return x+y; }" ;
41744195 ASSERT_EQUALS (" 1: int foo ( ) { auto [ x@1 , y@2 ] = xy ( ) ; return x@1 + y@2 ; }\n " ,
0 commit comments