[PATCH] D117232: [clang] Respect -Wdeclaration-after-statement with C99 or later

2022-01-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D117232#3258309 , @melver wrote: > Looks like https://reviews.llvm.org/D114787 does the same thing and was > submitted a week ago. > > I'll try to integrate the additional testing you suggested and change this > patch t

[PATCH] D117232: [clang] Respect -Wdeclaration-after-statement with C99 or later

2022-01-20 Thread Marco Elver via Phabricator via cfe-commits
melver added a comment. Looks like https://reviews.llvm.org/D114787 does the same thing and was submitted a week ago. I'll try to integrate the additional testing you suggested and change this patch to improve the implementation to not do the checking if not required as it doesn't look entirel

[PATCH] D117232: [clang] Respect -Wdeclaration-after-statement with C99 or later

2022-01-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Can you also add a release note about the change? Comment at: clang/test/Sema/warn-mixed-decls-code.c:1-3 +// RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -Wall -Wno-comment -DSILENCE %s +// RUN: %clang_cc1 -std=c99 -fsyntax-only -verify -Wall

[PATCH] D117232: [clang] Respect -Wdeclaration-after-statement with C99 or later

2022-01-20 Thread Marco Elver via Phabricator via cfe-commits
melver added a comment. Hello, A quick review would be much appreciated. I intend to submit this before Feb 1 so it may be included in Clang 14. In case I have not added the appropriate reviewer(s) of the modified code, please let me know. Thank you. Repository: rG LLVM Github Monorepo C

[PATCH] D117232: [clang] Respect -Wdeclaration-after-statement with C99 or later

2022-01-13 Thread Marco Elver via Phabricator via cfe-commits
melver created this revision. melver added reviewers: aaron.ballman, dblaikie, rsmith. melver requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. GCC allows using -Wdeclaration-after-statement to warn when mixing code and declarations not just