bool Complain) {
QualType FunctionType = ToType;
bool IsMember = false;
- if (const PointerLikeType *ToTypePtr = ToType->getAsPointerLikeType())
+ if (const PointerType *ToTypePtr = ToType->getAsPointerType())
FunctionType = ToTypePtr->getPointeeType();
+ else if (const ReferenceType *ToTypeRef = ToType->getAsReferenceType())
+ FunctionType = ToTypeRef->getPointeeType();
else if (const MemberPointerType *MemTypePtr =
ToType->getAsMemberPointerType()) {
FunctionType = MemTypePtr->getPointeeType();
// or incomplete types shall not be restrict-qualified." C++ also allows
// restrict-qualified references.
if (TypeQuals & QualType::Restrict) {
- if (const PointerLikeType *PT = Result->getAsPointerLikeType()) {
- QualType EltTy = PT->getPointeeType();
+ if (Result->isPointerType() || Result->isReferenceType()) {
+ QualType EltTy = Result->isPointerType() ?
+ Result->getAsPointerType()->getPointeeType() :
+ Result->getAsReferenceType()->getPointeeType();
// If we have a pointer or reference, the pointee must have an object or
// incomplete type.