Skip to content

Commit 66c0fc8

Browse files
da-vipergithub-actions[bot]
authored andcommitted
Automerge: [lldb] Fix unordered-map data formatter for const types (#156033)
The test was failing because the const qualifier is not removed when checking if the type is an `unordered_map`
2 parents 771f4f4 + f1a02c6 commit 66c0fc8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,11 @@ CompilerType lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEnd::
113113
// wraps a std::pair. Peel away the internal wrapper type - whose structure is
114114
// of no value to users, to expose the std::pair. This matches the structure
115115
// returned by the std::map synthetic provider.
116-
if (isUnorderedMap(m_backend.GetCompilerType()
117-
.GetNonReferenceType()
118-
.GetCanonicalType()
119-
.GetTypeName())) {
116+
CompilerType backend_type = m_backend.GetCompilerType();
117+
if (backend_type.IsPointerOrReferenceType())
118+
backend_type = backend_type.GetPointeeType();
119+
120+
if (isUnorderedMap(backend_type.GetCanonicalType().GetTypeName())) {
120121
std::string name;
121122
CompilerType field_type =
122123
element_type.GetFieldAtIndex(0, name, nullptr, nullptr, nullptr);

0 commit comments

Comments
 (0)