[cfe-commits] r65563 - in /cfe/trunk/lib/Sema: SemaOverload.cpp SemaType.cpp
Daniel Dunbar
daniel at zuster.org
Thu Feb 26 11:13:45 PST 2009
Author: ddunbar
Date: Thu Feb 26 13:13:44 2009
New Revision: 65563
URL: http://llvm.org/viewvc/llvm-project?rev=65563&view=rev
Log:
Drop uses of getAsPointerLikeType.
- No functionality change.
Modified:
cfe/trunk/lib/Sema/SemaOverload.cpp
cfe/trunk/lib/Sema/SemaType.cpp
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=65563&r1=65562&r2=65563&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Thu Feb 26 13:13:44 2009
@@ -3519,8 +3519,10 @@
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();
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=65563&r1=65562&r2=65563&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Thu Feb 26 13:13:44 2009
@@ -201,8 +201,10 @@
// 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.
More information about the cfe-commits
mailing list