diff options
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 9 |
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; } |