]> granicus.if.org Git - clang/commit
[Diagnostics] Warn if ?: with integer constants always evaluates to true
authorDavid Bolvansky <david.bolvansky@gmail.com>
Sun, 22 Sep 2019 22:00:48 +0000 (22:00 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Sun, 22 Sep 2019 22:00:48 +0000 (22:00 +0000)
commitb796ddf8a372d34c5d24107f59ead4cfbe850297
tree80bf35e71325a52c7ad4e22643a2c6933a01718b
parentc60de9debdf43be97665726bd9e58a8284df541a
[Diagnostics] Warn if ?: with integer constants always evaluates to true

Extracted from D63082. GCC has this warning under -Wint-in-bool-context, but as noted in the D63082's review, we should put it under TautologicalConstantCompare.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372531 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaChecking.cpp
test/Sema/warn-integer-constants-in-ternary.c [new file with mode: 0644]