[clang] Improve -Wdeclaration-after-statement
With 118f966b, Clang matches GCC's behaviour and allows enabling -Wdeclaration-after-statement with C99 and later. However, the check for mixing declarations and code is not a constant time algorithm, and therefore should be guarded with Diags.isIgnored(). Furthermore, improve test coverage with: non-pedantic C89 with the warning; C11 with the warning; and when using -Wall. Finally, mention the changed behaviour in ReleaseNotes.rst. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D117232
Loading
Please sign in to comment