diff options
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 587b18e7408..57bf94c0f0b 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -2310,8 +2310,11 @@ bool FunctionDecl::isReplaceableGlobalAllocationFunction() const { return true; // Otherwise, we're looking for a second parameter whose type is - // 'const std::nothrow_t &'. + // 'const std::nothrow_t &', or, in C++1y, 'std::size_t'. QualType Ty = FPT->getArgType(1); + ASTContext &Ctx = getASTContext(); + if (Ctx.getLangOpts().SizedDeallocation && Ty == Ctx.getSizeType()) + return true; if (!Ty->isReferenceType()) return false; Ty = Ty->getPointeeType(); |