aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-04-18 23:35:14 +0000
committerNate Begeman <natebegeman@mac.com>2008-04-18 23:35:14 +0000
commitd6595fa87cd031dab36c6dbb723ae19e822ab2aa (patch)
tree6f9178ce2ed3779a9e84a96b18532c85a37cbb0f
parent213541a68a3e137d11d2cefb612c6cdb410d7e8e (diff)
Ignore qualifiers when attempting to match arguments to parameter types for
__builtin_overload git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49943 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaExpr.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index fd02443d80..e3298f37af 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -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;
}