================ @@ -1593,34 +1593,31 @@ QualType Sema::BuildQualifiedType(QualType T, SourceLocation Loc, // object or incomplete types shall not be restrict-qualified." if (Qs.hasRestrict()) { unsigned DiagID = 0; - QualType ProblemTy; - - if (T->isAnyPointerType() || T->isReferenceType() || - T->isMemberPointerType()) { - QualType EltTy; - if (T->isObjCObjectPointerType()) - EltTy = T; - else if (const MemberPointerType *PTy = T->getAs<MemberPointerType>()) + QualType EltTy = Context.getBaseElementType(T); + + if (EltTy->isAnyPointerType() || EltTy->isReferenceType() || + EltTy->isMemberPointerType() || EltTy->isArrayType()) { ---------------- efriedma-quic wrote:
Drop the isArrayType() here; should be impossible for EltTy to be an array here. https://github.com/llvm/llvm-project/pull/120896 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits