[clang] [clang] Fix nondeterminism in MemberPointerType (PR #137910)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 30 07:54:25 PDT 2025


================
@@ -3610,7 +3611,7 @@ class MemberPointerType : public Type, public llvm::FoldingSetNode {
   }
 
   void Profile(llvm::FoldingSetNodeID &ID) {
-    Profile(ID, getPointeeType(), getQualifier(), getMostRecentCXXRecordDecl());
+    Profile(ID, getPointeeType(), getQualifier(), getCXXRecordDecl());
----------------
erichkeane wrote:

Hmm... then I'm surprised that this patch is needed at all for the purposes of non-determinism.  `getMostRecentCXXRecordDecl()->getCanonicalDecl()` will get the same declaration as `getCXXRecordDecl()->getCanonicalDecl()`.

https://github.com/llvm/llvm-project/pull/137910


More information about the cfe-commits mailing list