Issue 92178
Summary [clang-tidy] misc-redundant-_expression_ warns on templated check for NaN
Labels clang-tidy
Assignees
Reporter aeubanks
    clang-tidy properly doesn't warn on
```
bool isnan(float a) {
  return a != a;
}
```

however it does warn on the following:

```
$ cat /tmp/a.cc
template <typename T> bool isnan(T a) {
  return a != a;
}

bool isnan2(float a) {
  return isnan(a);
}

$ clang-tidy /tmp/a.cc --checks=misc-redundant-_expression_
1 warning generated.
/tmp/a.cc:2:12: warning: both sides of operator are equivalent [misc-redundant-_expression_]
    2 |   return a != a;
      | ^
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to