Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -2534,7 +2534,7 @@ if (accessibility == eAccessNone) accessibility = eAccessPublic; TypeSystemClang::AddVariableToRecordType( - class_clang_type, name, var_type->GetLayoutCompilerType(), + class_clang_type, name, var_type->GetForwardCompilerType(), accessibility); } return; Index: lldb/test/API/functionalities/lazy-loading/TestLazyLoading.py =================================================================== --- lldb/test/API/functionalities/lazy-loading/TestLazyLoading.py +++ lldb/test/API/functionalities/lazy-loading/TestLazyLoading.py @@ -40,6 +40,7 @@ class_in_namespace_decl = [class_decl_kind, "ClassInNamespace"] class_we_enter_decl = [class_decl_kind, "ClassWeEnter"] class_member_decl = [struct_decl_kind, "ClassMember"] + class_static_member_decl = [struct_decl_kind, "StaticClassMember"] unused_class_member_decl = [struct_decl_kind, "UnusedClassMember"] unused_class_member_ptr_decl = [struct_decl_kind, "UnusedClassMemberPtr"] @@ -56,6 +57,7 @@ self.assert_decl_not_loaded(self.other_struct_decl) self.assert_decl_not_loaded(self.class_in_namespace_decl) self.assert_decl_not_loaded(self.class_member_decl) + self.assert_decl_not_loaded(self.class_static_member_decl) self.assert_decl_not_loaded(self.unused_class_member_decl) def get_ast_dump(self): @@ -228,6 +230,8 @@ self.assert_decl_not_completed(self.unused_class_member_ptr_decl) # We loaded the member we used. self.assert_decl_loaded(self.class_member_decl) + # We didn't load the type of the unused static member. + self.assert_decl_not_completed(self.class_static_member_decl) # This should not have loaded anything else. self.assert_decl_not_loaded(self.other_struct_decl) Index: lldb/test/API/functionalities/lazy-loading/main.cpp =================================================================== --- lldb/test/API/functionalities/lazy-loading/main.cpp +++ lldb/test/API/functionalities/lazy-loading/main.cpp @@ -23,6 +23,7 @@ // Class loading declarations. struct ClassMember { int i; }; +struct StaticClassMember { int i; }; struct UnusedClassMember { int i; }; struct UnusedClassMemberPtr { int i; }; @@ -34,12 +35,14 @@ public: int dummy; // Prevent bug where LLDB always completes first member. ClassMember member; + static StaticClassMember static_member; UnusedClassMember unused_member; UnusedClassMemberPtr *unused_member_ptr; int enteredFunction() { return member.i; // Location: class function } }; +StaticClassMember ClassWeEnter::static_member; }; //----------------------------------------------------------------------------//