Skip to content

Commit 04130f2

Browse files
committed
[clang] WIP: Fix MemberPointer serialization non-determinism
This fixes a problem originally reported here: #132401 (comment) This makes sure we only serialize the class declaration when its strictly needed, and canonicalizes it, so it doesn't change in ways that don't round trip. There are no release notes, since this regression was never released.
1 parent 052225d commit 04130f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/include/clang/AST/TypeProperties.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ let Class = MemberPointerType in {
104104
let Read = [{ node->getQualifier() }];
105105
}
106106
def : Property<"Cls", DeclRef> {
107-
let Read = [{ node->getMostRecentCXXRecordDecl() }];
107+
let Read =
108+
[{ node->isSugared() ? node->getMostRecentCXXRecordDecl()->getCanonicalDecl() : nullptr }];
108109
}
109110

110111
def : Creator<[{

0 commit comments

Comments
 (0)