Issue 168854
Summary [clang] `-Wcharacter-conversion` should warn on `wchar_t` conversions
Labels clang
Assignees
Reporter eisenwave
    https://compiler-explorer.com/z/6zb99Y8Yj
```cpp
void f(char8_t c8, char16_t c16, wchar_t cw) {
    bool a = c8 == c16;
    bool b = c8 == cw;
}
```
Currently, only the first line raises `-Wcharacter-conversion`; the second line doesn't.

However, a comparison between `char8_t` and `wchar_t` is just as nonsensical as a comparison between `char8_t` and `char16_t`, so this seems like a false negative. That is especially true when considering that `wchar_t` is often UTF-16 or UTF-32, depending on the platform.

CC @cor3ntin 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to