| Issue |
125759
|
| Summary |
clang false -Wtautological-unsigned-zero-compare warning.
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
pawelsopensource
|
Hi, The following code triggers false positive warning about comparison < 0. The 'if limit ' shortcuts _expression_ evaluation.
```
static constexpr unsigned limit = 0;
bool check( unsigned x ) {
if ( limit && ( x < limit ) )
return false;
return true;
}
error: result of comparison of unsigned _expression_ < 0 is always false [-Werror,-Wtautological-unsigned-zero-compare]
if ( limit && ( x < limit ) )
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs