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
Showing
- include/clang/Basic/DiagnosticSemaKinds.td 4 additions, 0 deletionsinclude/clang/Basic/DiagnosticSemaKinds.td
- include/clang/Sema/Sema.h 2 additions, 0 deletionsinclude/clang/Sema/Sema.h
- lib/Sema/SemaExpr.cpp 64 additions, 0 deletionslib/Sema/SemaExpr.cpp
- lib/Sema/SemaStmt.cpp 28 additions, 0 deletionslib/Sema/SemaStmt.cpp
- test/SemaCXX/warn-comma-operator.cpp 278 additions, 0 deletionstest/SemaCXX/warn-comma-operator.cpp
Loading
Please register or sign in to comment