https://llvm.org/bugs/show_bug.cgi?id=31201
Bug ID: 31201
Summary: Implement -Wint-in-bool-context
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
gcc has a new warning: -Wint-in-bool-context
For example, this code:
#include <assert.h>
void foo() {
int a=0, b=0;
assert(a <= b ? 2 : 3);
}
Will returns:
foo.c:4:19: error: ?: using integer constants in boolean context, the
expression will always evaluate to 'true' [-Werror=int-in-bool-context]
assert(a <= b ? 2 : 3);
^
When clang-4.0 -Wall will not show anything
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs