]> granicus.if.org Git - clang/commit
Add -Wcomma warning to Clang.
authorRichard Trieu <rtrieu@google.com>
Thu, 18 Feb 2016 23:58:40 +0000 (23:58 +0000)
committerRichard Trieu <rtrieu@google.com>
Thu, 18 Feb 2016 23:58:40 +0000 (23:58 +0000)
commitba3bb7db1d551babd413964db6b48de7d2ed523c
treec137d1932a3830a843e03844a637781e0d5fab64
parentd4539e33f0abee857265ac86237943585823f1b7
Add -Wcomma warning to Clang.

-Wcomma will detect and warn on most uses of the builtin comma operator.  It
currently whitelists the first and third statements of the for-loop.  For other
cases, the warning can be silenced by casting the first operand of the comma
operator to void.

Differential Revision: http://reviews.llvm.org/D3976

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261278 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Sema/SemaExpr.cpp
lib/Sema/SemaStmt.cpp
test/SemaCXX/warn-comma-operator.cpp [new file with mode: 0644]