https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80552
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> --- FTR, a way to deal with the consecutive relative line numbers pattern using dg-line would be: ... foobar; /* { dg-line foobar_line } */ /* { dg-warning "warning for foobar" foobar_line } { dg-warning "another warning for foobar" foobar_line } { dg-error "error for foobar" foobar_line } */ ... but that requires you to come up with a variable name for the line. It's better to have a solution that can be applied mechanically.