Reverted r64307. Moved hasSameType and hasSameUnqualifiedType from
Sema to ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64312 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index b4436a2..5fe592d 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -920,7 +920,7 @@
       (ParamType->isMemberPointerType() &&
        ParamType->getAsMemberPointerType()->getPointeeType()
          ->isFunctionType())) {
-    if (ArgType.isSameIgnoringQualifiers(ParamType.getNonReferenceType())) {
+    if (Context.hasSameUnqualifiedType(ArgType, ParamType.getNonReferenceType())) {
       // We don't have to do anything: the types already match.
     } else if (ArgType->isFunctionType() && ParamType->isPointerType()) {
       ArgType = Context.getPointerType(ArgType);
@@ -935,7 +935,7 @@
       }
     }
 
-    if (!ArgType.isSameIgnoringQualifiers(ParamType.getNonReferenceType())) {
+    if (!Context.hasSameUnqualifiedType(ArgType, ParamType.getNonReferenceType())) {
       // We can't perform this conversion.
       Diag(Arg->getSourceRange().getBegin(), 
            diag::err_template_arg_not_convertible)
@@ -965,7 +965,7 @@
       ImpCastExprToType(Arg, ParamType);
     }
     
-    if (!ArgType.isSameIgnoringQualifiers(ParamType)) {
+    if (!Context.hasSameUnqualifiedType(ArgType, ParamType)) {
       // We can't perform this conversion.
       Diag(Arg->getSourceRange().getBegin(), 
            diag::err_template_arg_not_convertible)
@@ -988,7 +988,7 @@
     assert(ParamRefType->getPointeeType()->isObjectType() &&
            "Only object references allowed here");
 
-    if (!ArgType.isSameIgnoringQualifiers(ParamRefType->getPointeeType())) {
+    if (!Context.hasSameUnqualifiedType(ParamRefType->getPointeeType(), ArgType)) {
       Diag(Arg->getSourceRange().getBegin(), 
            diag::err_template_arg_no_ref_bind)
         << Param->getType() << Arg->getType()
@@ -1020,7 +1020,7 @@
   //        member, qualification conversions (4.4) are applied.
   assert(ParamType->isMemberPointerType() && "Only pointers to members remain");
 
-  if (ParamType.isSameIgnoringQualifiers(ArgType)) {
+  if (Context.hasSameUnqualifiedType(ParamType, ArgType)) {
     // Types match exactly: nothing more to do here.
   } else if (IsQualificationConversion(ArgType, ParamType)) {
     ImpCastExprToType(Arg, ParamType);