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

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 10:12:32 PDT 2022


aeubanks created this revision.
aeubanks added a reviewer: DavidSpickett.
Herald added a project: All.
aeubanks requested review of this revision.
Herald added projects: clang, LLDB.
Herald added subscribers: lldb-commits, cfe-commits.

Similar to D135170 <https://reviews.llvm.org/D135170>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135461

Files:
  clang/lib/AST/StmtPrinter.cpp
  lldb/test/API/lang/cpp/const_static_integral_member/main.cpp


Index: lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
===================================================================
--- lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
+++ lldb/test/API/lang/cpp/const_static_integral_member/main.cpp
@@ -35,6 +35,7 @@
   const static auto longlong_max = std::numeric_limits<long long>::max();
   const static auto ulonglong_max =
       std::numeric_limits<unsigned long long>::max();
+  const static auto wchar_max = std::numeric_limits<wchar_t>::max();
 
   const static auto char_min = std::numeric_limits<char>::min();
   const static auto uchar_min = std::numeric_limits<unsigned char>::min();
@@ -45,6 +46,7 @@
   const static auto longlong_min = std::numeric_limits<long long>::min();
   const static auto ulonglong_min =
       std::numeric_limits<unsigned long long>::min();
+  const static auto wchar_min = std::numeric_limits<wchar_t>::min();
 
   const static Enum enum_val = enum_case2;
   const static ScopedEnum scoped_enum_val = ScopedEnum::scoped_enum_case2;
Index: clang/lib/AST/StmtPrinter.cpp
===================================================================
--- clang/lib/AST/StmtPrinter.cpp
+++ clang/lib/AST/StmtPrinter.cpp
@@ -1293,6 +1293,9 @@
     break; // no suffix.
   case BuiltinType::UInt128:
     break; // no suffix.
+  case BuiltinType::WChar_S:
+  case BuiltinType::WChar_U:
+    break; // no suffix.
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135461.466114.patch
Type: text/x-patch
Size: 1415 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221007/ad45f64d/attachment-0001.bin>


More information about the cfe-commits mailing list