Improve fail_compilation tests by using `TEST_OUTPUT`
fix Issue 11146 - Wrong line number of "identity assignment operator overload is illegal"
Merge pull request #2602 from 9rnsr/fix11146

Issue 11146 - Wrong line number of "identity assignment operator overload is illegal"