]> granicus.if.org Git - clang/commit
Warn about missing parentheses for conditional operator.
authorHans Wennborg <hans@hanshq.net>
Fri, 3 Jun 2011 18:00:36 +0000 (18:00 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 3 Jun 2011 18:00:36 +0000 (18:00 +0000)
commit9cfdae3144fc004cf203b05288f4dab49097ce7b
tree891eb9b9b606a1d0e0d85b46a9dc1c93faa7f123
parent78e9c55c9acc85d82f4dd53a49c05310b4b56a1b
Warn about missing parentheses for conditional operator.

Warn in cases such as "x + someCondition ? 42 : 0;",
where the condition expression looks arithmetic, and has
a right-hand side that looks boolean.

This (partly) addresses http://llvm.org/bugs/show_bug.cgi?id=9969

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132565 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaExpr.cpp
test/Sema/parentheses.c
test/Sema/parentheses.cpp [new file with mode: 0644]