================
@@ -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()) {
----------------
erichkeane wrote:

>MemberPointerType seems to be both for data members or functions.

I would expect both of those to have a `CXXRecordDecl`.

>Or I guess it can be neither if is a template parameter? (see test75)

Ok, so that looks like the record decl is null because the 'class' is dependent 
(see that `getMostRecentCXXDecl` does `getClass` as part of its implementation).

Should we be taking visibility from that `getClass` in this case?  It is a 
dependent expression in this case, but perhaps we should be?

https://github.com/llvm/llvm-project/pull/136689
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to