testsuite: Add compile-fail test for #5883