Regression test for #12742