================ @@ -8836,13 +8836,22 @@ void FixedPointValueToString(SmallVectorImpl<char> &Str, llvm::APSInt Val, unsigned Scale); inline FunctionEffectsRef FunctionEffectsRef::get(QualType QT) { + const Type *TypePtr = QT.getTypePtr(); while (true) { - QualType Pointee = QT->getPointeeType(); - if (Pointee.isNull()) + // Note that getPointeeType() seems to successfully navigate some constructs + // for which isAnyPointerType() returns false (e.g. + // pointer-to-member-function). + QualType Pointee = TypePtr->getPointeeType(); + if (Pointee.isNull()) { + if (TypePtr->isArrayType()) { + TypePtr = TypePtr->getBaseElementTypeUnsafe(); + continue; + } break; - QT = Pointee; + } + TypePtr = Pointee.getTypePtr(); } - if (const auto *FPT = QT->getAs<FunctionProtoType>()) + if (const auto *FPT = TypePtr->getAs<FunctionProtoType>()) ---------------- dougsonos wrote:
``` inline bool Type::isAnyPointerType() const { return isPointerType() || isObjCObjectPointerType(); } inline bool Type::isPointerType() const { return isa<PointerType>(CanonicalType); } inline bool Type::isMemberPointerType() const { return isa<MemberPointerType>(CanonicalType); } inline bool Type::isMemberFunctionPointerType() const { if (const auto *T = getAs<MemberPointerType>()) return T->isMemberFunctionPointer(); else return false; } ``` https://github.com/llvm/llvm-project/pull/121525 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits