summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/AttrImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/AttrImpl.cpp')
-rw-r--r--clang/lib/AST/AttrImpl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/AttrImpl.cpp b/clang/lib/AST/AttrImpl.cpp
index d13d4b326c3..d81979734b3 100644
--- a/clang/lib/AST/AttrImpl.cpp
+++ b/clang/lib/AST/AttrImpl.cpp
@@ -40,7 +40,7 @@ void AttrWithString::Destroy(ASTContext &C) {
void AttrWithString::ReplaceString(ASTContext &C, llvm::StringRef newS) {
if (newS.size() > StrLen) {
C.Deallocate(const_cast<char*>(Str));
- Str = new char[newS.size()];
+ Str = new (C) char[newS.size()];
}
StrLen = newS.size();
memcpy(const_cast<char*>(Str), newS.data(), StrLen);
OpenPOWER on IntegriCloud