Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ Error UdtRecordCompleter::visitKnownMember(
// Static constant members may be a const[expr] declaration.
// Query the symbol's value as the variable initializer if valid.
if (member_ct.IsConst() && member_ct.IsCompleteType()) {
std::string qual_name = decl->getQualifiedNameAsString();
std::string qual_name;
if (m_record.record.kind == Member::Struct)
qual_name = (m_cvr.cr.Name + "::" + static_data_member.Name).str();
else if (m_record.record.kind == Member::Union)
qual_name = (m_cvr.ur.Name + "::" + static_data_member.Name).str();
else
qual_name = decl->getQualifiedNameAsString();

auto results =
m_index.globals().findRecordsByName(qual_name, m_index.symrecords());
Expand Down
5 changes: 4 additions & 1 deletion lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ namespace {
int AnonymousMember;
// And a nested class within an anonymous namespace
struct D {
static constexpr int StaticMember = 1;
int AnonymousDMember;
};
};
Expand Down Expand Up @@ -177,12 +178,14 @@ int SI::*mp9 = nullptr;
// CHECK: | `-CXXRecordDecl {{.*}} struct Anonymous<A::B::C<void>> definition
// CHECK: | |-FieldDecl {{.*}} AnonymousMember 'int'
// CHECK: | `-CXXRecordDecl {{.*}} struct D definition
// CHECK: | |-VarDecl {{.*}} StaticMember 'const int' static cinit
// CHECK: | | `-IntegerLiteral {{.*}} 'int' 1
// CHECK: | `-FieldDecl {{.*}} AnonymousDMember 'int'

int main(int argc, char **argv) {
AnonInt.AnonymousMember = 1;
AnonABCVoid.AnonymousMember = 2;
AnonABCVoidD.AnonymousDMember = 3;

return 0;
return AnonABCVoidD.StaticMember;
}
Loading