Improve fail_compilation tests by using `TEST_OUTPUT`
fix Issue 11145 - Duplicated deprecation message "use of typedef is deprecated;"
Merge pull request #2601 from 9rnsr/fix11145

Issue 11145 - Duplicated deprecation message "use of typedef is deprecated;"