[PATCH] D155610: [Clang][ExprConstant] Print integer instead of character on static assertion failure
Corentin Jabot via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 1 06:39:19 PDT 2023
cor3ntin added inline comments.
================
Comment at: clang/lib/Basic/Diagnostic.cpp:838-858
+ if (UseUCN)
+ OutStream << "\\u"
+ << llvm::format_hex_no_prefix(CodepointValue, /*Width=*/4,
+ /*Upper=*/false);
+ else
+ OutStream << "<U+"
+ << llvm::format_hex_no_prefix(CodepointValue, /*Width=*/4,
----------------
hazohelet wrote:
> cor3ntin wrote:
> > The use UCN addition is probably not justified. we should consistent in how we print the value of non-printable code points.
> My motivation here is to print a valid character literal. I think it justifies this change somewhat. I'd like to see what others think about this.
Why? there is no expectation that diagnostics messages reproduce C++. Consistency between string literals and characters literals is a lot more important
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155610/new/
https://reviews.llvm.org/D155610
More information about the cfe-commits
mailing list