aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index fd95f4e..0edfd60 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -3461,11 +3461,11 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,
// non-templated allocation function we are trying to declare here.
if (FunctionDecl *Func = dyn_cast<FunctionDecl>(*Alloc)) {
if (Func->getNumParams() == Params.size()) {
- llvm::SmallVector<QualType, 3> FuncParams;
- for (auto *P : Func->parameters())
- FuncParams.push_back(
- Context.getCanonicalType(P->getType().getUnqualifiedType()));
- if (llvm::ArrayRef(FuncParams) == Params) {
+ if (std::equal(Func->param_begin(), Func->param_end(), Params.begin(),
+ Params.end(), [&](ParmVarDecl *D, QualType RT) {
+ return Context.hasSameUnqualifiedType(D->getType(),
+ RT);
+ })) {
// Make the function visible to name lookup, even if we found it in
// an unimported module. It either is an implicitly-declared global
// allocation function, or is suppressing that function.