-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Description
I don't think this is intended:
void fun(char32_t);
const char16_t c16 = ~~~'
fun(c16); // warning: implicit conversion from 'const char16_t' to 'char32_t' may change the meaning of the represented code unit (OK)
fun(char32_t{c16}); // SAME warning (incl. "implicit conversion")
I explicitly convert, why is it still complaining?
This particular warning was, of course, removed by #163927, but I guess the same still applies for, say, char8_t -> char32_t.
Using parentheses instead of braces fixes the issue, but I'd like to use braces for their static narrowing prevention.
Another thing I noted is that the warning, for the same code, isn't emitted if I make the function containing it constexpr.
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer