[Lldb-commits] [PATCH] D135461: [LLDB] Fix crash when printing a struct with a static wchar_t member

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 10 02:56:52 PDT 2022


DavidSpickett added a comment.

You need to update the python file for the test as well.

What does the output look like, do we actually print the character itself or it's value? (just curious, which one we do is probably out of scope for this change)



================
Comment at: clang/lib/AST/StmtPrinter.cpp:1298
+  case BuiltinType::WChar_U:
+    break; // no suffix.
   }
----------------
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.


================
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();
 
----------------
Is there a specific `signed wchar_t` and `unsigned wchar_t` like for char?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135461



More information about the lldb-commits mailing list