]> granicus.if.org Git - clang/commitdiff
Ensure that a operator delete overload is rocognized regardless of cv-quals.
authorChandler Carruth <chandlerc@gmail.com>
Mon, 8 Feb 2010 18:54:05 +0000 (18:54 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 8 Feb 2010 18:54:05 +0000 (18:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95553 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclCXX.cpp
test/SemaCXX/new-delete.cpp

index 02ad36d47909e78132fcaa529406d928e2ea9285..a519f78fc45d74ba46d4e1e0de093318f6e00476 100644 (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 
index 6f8955534311abd2f88d0c6e3f2376bf3dd70f66..acd4a23cb35afd6a7c6fcf20c0db3fd2df55830b 100644 (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() {