https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69718
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- Jeff, the usual way would be to use dg-error to match the diagnostics and lines where an error is expected. Something like: typename foo(Init) requires Concept<foo> { // { dg-error "expected nested-name" "" { *-*-* } .-1 } // { dg-error "'Init' has not been declared" "" { *-*-* } .-2 } The .-1 line number means one line previous, and .-2 means two lines previous. Please send the patch to the gcc-patches mailing list, thanks!