diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -1280,6 +1280,7 @@ case BuiltinType::Char_S: case BuiltinType::Char_U: OS << "i8"; break; case BuiltinType::UChar: OS << "Ui8"; break; + case BuiltinType::SChar: OS << "i8"; break; case BuiltinType::Short: OS << "i16"; break; case BuiltinType::UShort: OS << "Ui16"; break; case BuiltinType::Int: break; // no suffix. diff --git a/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py b/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py --- a/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py +++ b/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py @@ -32,11 +32,6 @@ # Test a bool member. self.expect_expr("A::bool_val", result_value="true") - # Test a bool member when printing the struct it is a member of. - # TODO: replace this with printing struct A, once doing so doesn't crash lldb. - self.expect("image lookup -t StaticBoolStruct", - substrs=["static const bool value = false;"]) - # Test that minimum and maximum values for each data type are right. self.expect_expr("A::char_max == char_max", result_value="true") self.expect_expr("A::uchar_max == uchar_max", result_value="true") @@ -88,6 +83,10 @@ self.expect_expr("const int *i = &A::int_val_with_address; *i", result_value="2") + # Printing the whole type takes a slightly different code path. Check that + # it does not crash. + self.expect("image lookup -t A") + # dsymutil strips the debug info for classes that only have const static # data members without a definition namespace scope. @expectedFailureAll(debug_info=["dsym"]) diff --git a/lldb/test/API/lang/cpp/const_static_integral_member/main.cpp b/lldb/test/API/lang/cpp/const_static_integral_member/main.cpp --- a/lldb/test/API/lang/cpp/const_static_integral_member/main.cpp +++ b/lldb/test/API/lang/cpp/const_static_integral_member/main.cpp @@ -79,13 +79,8 @@ ScopedEnum::scoped_enum_case1; }; -struct StaticBoolStruct { - static const bool value = false; -}; - int main() { A a; - StaticBoolStruct sbs; auto char_max = A::char_max; auto uchar_max = A::uchar_max;