Ensure that a operator delete overload is rocognized regardless of cv-quals.

llvm-svn: 95553
This commit is contained in:
Chandler Carruth 2010-02-08 18:54:05 +00:00
parent eaabbd8b46
commit 75cc359fdc
2 changed files with 10 additions and 1 deletions

View File

@ -587,7 +587,8 @@ bool CXXMethodDecl::isUsualDeallocationFunction() const {
// then this function is a usual deallocation function.
ASTContext &Context = getASTContext();
if (getNumParams() != 2 ||
!Context.hasSameType(getParamDecl(1)->getType(), Context.getSizeType()))
!Context.hasSameUnqualifiedType(getParamDecl(1)->getType(),
Context.getSizeType()))
return false;
// This function is a usual deallocation function if there are no

View File

@ -217,6 +217,14 @@ static void* f(void* g)
return new (g) X13();
}
class X14 {
static void operator delete(void*, const size_t);
};
void f(X14 *x14a, X14 *x14b) {
delete x14a;
}
namespace PR5918 { // Look for template operator new overloads.
struct S { template<typename T> static void* operator new(size_t, T); };
void test() {