-Wdeclaration-after-statement currently only outputs an diagnostic if the user is compiling in C versions older than C99, even if the warning was explicitly requested by the user.
This patch makes the warning also available in later C versions. If the C version is C99 or later it is simply a normal warning that is disabled by default (as it is valid C99) and has to be enabled by users. In older versions it remains an extension warning, and therefore affected by -pedantic.
The above behaviour also matches GCCs behaviour.
In the other review, I left a comment about the diagnostic text: https://reviews.llvm.org/D115094#3176985
Since we're cleaning this up, I think we should reword this diagnostic so it follows newer conventions. I think the extension diagnostic should read: mixing declarations and code is a C99 extension and the default ignore warning should read mixing declarations and code is incompatible with standards before C99. (This also helpfully removes the ISO C90 wording, which is confused about the name of the standard.)
Typically, we'd put the default ignore warning under a new CPre99Compat diagnostic group (spelled pre-c99-compat) as we do with other precompat diagnostics, but the goal here is to match GCC's behavior and so the existing warning group seems fine to me (I don't think we want warnings in multiple groups, but that's possibly an option if it matters in the future).