Drop uses of getAsPointerLikeType.

- No functionality change.

llvm-svn: 65563
This commit is contained in:
Daniel Dunbar 2009-02-26 19:13:44 +00:00
parent de68001e76
commit b566c6c758
2 changed files with 7 additions and 3 deletions

View File

@ -3519,8 +3519,10 @@ Sema::ResolveAddressOfOverloadedFunction(Expr *From, QualType ToType,
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();

View File

@ -201,8 +201,10 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS) {
// 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.