aeubanks added inline comments.
================ Comment at: clang/lib/AST/StmtPrinter.cpp:1298 + case BuiltinType::WChar_U: + break; // no suffix. } ---------------- DavidSpickett wrote: > Is there any reason to have a suffix here? > > I admit this function is puzzling to me anyway given that char has a prefix > and this won't. Perhaps this is because char here is not "character" it's an > integer of a certain size. Where wide char is more about, well, being an > actual character. > > And reading https://en.cppreference.com/w/cpp/language/character_literal the > suffix would be "L" which we've already used. > > As long as it prints in a way that's useful for the developer that's fine. https://en.cppreference.com/w/cpp/language/character_literal is about char literal prefixes, which is not what this is e.g. ``` $ lldb a.out (lldb) im loo -t A ... static const unsigned char uchar_max = 255Ui8; ``` this output isn't valid C++, I believe it's just more clarification for the user on the exact type of the integer literal. I could make this output something like "UW"/"SW"? with and without this change, we already have ``` (lldb) print A::wchar_min (const wchar_t) $0 = L'\U0000fffd' ``` this change makes the following not crash ``` $ lldb a.out (lldb) im loo -t A ... static const wchar_t wchar_max = 2147483647; ``` any suffix we choose here is appended to the `2147483647` ================ Comment at: lldb/test/API/lang/cpp/const_static_integral_member/main.cpp:38 std::numeric_limits<unsigned long long>::max(); + const static auto wchar_max = std::numeric_limits<wchar_t>::max(); ---------------- DavidSpickett wrote: > Is there a specific `signed wchar_t` and `unsigned wchar_t` like for char? ``` /tmp/a.cc:1:7: error: 'wchar_t' cannot be signed or unsigned [-Wsigned-unsigned-wchar] const unsigned wchar_t a = 0; ``` https://en.cppreference.com/w/cpp/language/types ``` wchar_t - type for wide character representation (see wide strings). It has the same size, signedness, and alignment as one of the integer types, but is a distinct type. ``` so it sounds like under the hood the signedness is platform dependent, but there's only one wchar_t type Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135461/new/ https://reviews.llvm.org/D135461 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits