Use CheckAssignmentConstraints for checking the cleanup attr function. Fixes PR3656.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65461 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index ce38edd..fb8b795 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -955,7 +955,7 @@
   // If this ever proves to be a problem it should be easy to fix.
   QualType Ty = S.Context.getPointerType(VD->getType());
   QualType ParamTy = FD->getParamDecl(0)->getType();
-  if (Ty != ParamTy) {
+  if (S.CheckAssignmentConstraints(Ty, ParamTy) != Sema::Compatible) {
     S.Diag(Attr.getLoc(), 
            diag::err_attribute_cleanup_func_arg_incompatible_type) <<
       Attr.getParameterName() << ParamTy << Ty;