Skip to content
Merged
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
5 changes: 4 additions & 1 deletion clang/lib/AST/TextNodeDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,10 @@ void TextNodeDumper::Visit(const APValue &Value, QualType Ty) {
}

ColorScope Color(OS, ShowColors, DeclNameColor);
OS << Value.getMemberPointerDecl()->getDeclName();
if (const ValueDecl *MemDecl = Value.getMemberPointerDecl())
OS << MemDecl->getDeclName();
else
OS << "null";
return;
}
case APValue::AddrLabelDiff:
Expand Down
8 changes: 6 additions & 2 deletions clang/test/AST/ast-dump-APValue-lvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ void Test(int (&arr)[10]) {
// CHECK-NEXT: | |-value: LValue Base=TypeInfoLValue typeid(int), Null=0, Offset=0, HasPath=1, PathLength=0, Path=()

constexpr int(MP::*pmi) = (int MP::*)&P::x;
// CHECK: `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} pmi 'int (MP::*const)' constexpr cinit
// CHECK-NEXT: |-value: MemberPointer MP::x
// CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} pmi 'int (MP::*const)' constexpr cinit
// CHECK-NEXT: | |-value: MemberPointer MP::x

constexpr int(MP::*pmn) = (int MP::*)nullptr;
// CHECK: `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} pmn 'int (MP::*const)' constexpr cinit
// CHECK-NEXT: |-value: MemberPointer null
}
Loading