]> granicus.if.org Git - clang/commitdiff
Ignore qualifiers when attempting to match arguments to parameter types for
authorNate Begeman <natebegeman@mac.com>
Fri, 18 Apr 2008 23:35:14 +0000 (23:35 +0000)
committerNate Begeman <natebegeman@mac.com>
Fri, 18 Apr 2008 23:35:14 +0000 (23:35 +0000)
__builtin_overload

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49943 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index fd02443d80f5b747a4037ca3013f1e5b5f3c2818..e3298f37af5b2ec4a594e684bd76f814fd53ccd5 100644 (file)
@@ -2168,10 +2168,13 @@ Sema::ExprResult Sema::ActOnChooseExpr(SourceLocation BuiltinLoc, ExprTy *cond,
 /// arguments in FnType.
 static bool ExprsMatchFnType(Expr **Args, const FunctionTypeProto *FnType) {
   unsigned NumParams = FnType->getNumArgs();
-  for (unsigned i = 0; i != NumParams; ++i)
-    if (Args[i]->getType().getCanonicalType() != 
-        FnType->getArgType(i).getCanonicalType())
+  for (unsigned i = 0; i != NumParams; ++i) {
+    QualType ExprTy = Args[i]->getType().getCanonicalType();
+    QualType ParmTy = FnType->getArgType(i).getCanonicalType();
+
+    if (ExprTy.getUnqualifiedType() != ParmTy.getUnqualifiedType())
       return false;
+  }
   return true;
 }