================
@@ -9015,11 +9015,20 @@ bool Sema::RequireCompleteTypeImpl(SourceLocation Loc, 
QualType T,
 
   if (const MemberPointerType *MPTy = T->getAs<MemberPointerType>()) {
     if (!MPTy->getClass()->isDependentType()) {
-      if (getLangOpts().CompleteMemberPointers &&
-          !MPTy->getClass()->getAsCXXRecordDecl()->isBeingDefined() &&
-          RequireCompleteType(Loc, QualType(MPTy->getClass(), 0), Kind,
-                              diag::err_memptr_incomplete))
-        return true;
+      if (getLangOpts().CompleteMemberPointers) {
+        const CXXRecordDecl *RD = MPTy->getClass()->getAsCXXRecordDecl();
+        if (RD->isBeingDefined()) {
+          if (RD->isParsingBaseSpecifiers()) {
----------------
MitalAshok wrote:

I really only want to call `RequireCompleteType`in the else branch  when 
`!RD->isBeingDefined()` (when called while `RD->isParsingBaseSpecifiers()`, 
there's an extra note 'definition of "[class name]" is incomplete until the 
closing "}"', which is misleading since for CompleteMemberPointers purposes 
it's complete after the bases are parsed)



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

Reply via email to