]> granicus.if.org Git - clang/commit
[Parse] Make -Wgcc-compat complain about for loop inits in C89
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 28 Jun 2018 21:36:00 +0000 (21:36 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 28 Jun 2018 21:36:00 +0000 (21:36 +0000)
commiteed865ada8669f873c9abdcee9c2818cb17ee550
tree85168d7a4c7b759035b3dda58763aa6a4b9ff265
parent8b67bbb0952f6661deea1b2dad51a41519544522
[Parse] Make -Wgcc-compat complain about for loop inits in C89

While clang allows declarations in for loop init statements in c89 and
gnu89, gcc does not. So, we should probably warn if users care about gcc
compatibility.

Differential Revision: https://reviews.llvm.org/D47840

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335927 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticParseKinds.td
lib/Parse/ParseStmt.cpp
test/Parser/gcc-for-loop-init-compatibility.c [new file with mode: 0644]