cor3ntin added a comment.

I agree with Aaron that in the current state, the common case diagnostics are 
made worse. But there is room for improvement!

I think what we want to do here is modify `ConvertAPValueToString` so that it 
applies the same escape logic to `char` as we do in `pushEscapedString` (in 
Diagnostics.cpp)
It would make sense that `signed`/`unsigned` are treated as integers (in which 
case they should not be quoted), but `char`, `wchar_t`, `charN_t` should try 
really hard to present a printable character to the user, unless it's not 
possible to do so.

So the best way to progress that might be:

- put `pushEscapedString` somewhere we can reuse
- make char/char8_t use this function in `ConvertAPValueToString` - it might be 
slightly more tricky for wchar_t, you would have to try to convert to utf-8 
first.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155610/new/

https://reviews.llvm.org/D155610

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to