[PATCH] D85097: [Sema] add warning for comparisons like 'x<=y<=z'
Vince Bridgers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 2 10:47:08 PDT 2020
vabridgers created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
vabridgers requested review of this revision.
This changes add a new warning named -Wcompare-op-parentheses that's
part of the -Wparentheses diagnostic group. This diagnostic produces a
warning when a pattern like 'x<=y<=z' is found. When this pattern is not
qualified by parentheses, it's equivalent to '(x<=y ? 1 : 0) <= z',
which is a different interpretation from that of ordinary mathematical
notation.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D85097
Files:
clang/docs/DiagnosticsReference.rst
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaExpr.cpp
clang/test/Misc/warning-wall.c
clang/test/Sema/warn-compare-op-parentheses.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85097.282467.patch
Type: text/x-patch
Size: 9980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200802/da277f74/attachment.bin>
More information about the cfe-commits
mailing list