[clang] Reland [clang] Handle instantiated members to determine visibility (#136128) (PR #136689)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 22 07:52:16 PDT 2025


================
@@ -4787,8 +4787,10 @@ LinkageInfo LinkageComputer::computeTypeLinkageInfo(const Type *T) {
     return computeTypeLinkageInfo(cast<ReferenceType>(T)->getPointeeType());
   case Type::MemberPointer: {
     const auto *MPT = cast<MemberPointerType>(T);
-    LinkageInfo LV =
-        getDeclLinkageAndVisibility(MPT->getMostRecentCXXRecordDecl());
+    LinkageInfo LV;
+    if (CXXRecordDecl *D = MPT->getMostRecentCXXRecordDecl()) {
----------------
mizvekov wrote:

Yes, the most recent decl will be null in most dependent cases, except when you have an injected class (ie referring to the class template itself inside its definition).

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


More information about the cfe-commits mailing list