[ClangImporter] Use new CXXThisExpr::Create function

The constructor takes a new arg which `Create` now handles. Use it
instead.
This commit is contained in:
Ben Barham
2024-03-21 20:25:59 -07:00
parent b33055038e
commit 0c0c4ea7c3
3 changed files with 8 additions and 7 deletions

View File

@@ -2114,8 +2114,9 @@ clang::CXXMethodDecl *SwiftDeclSynthesizer::synthesizeCXXForwardingMethod(
auto diagState = clangSema.DelayedDiagnostics.push(diagPool);
// Construct the method's body.
clang::Expr *thisExpr = new (clangCtx) clang::CXXThisExpr(
clang::SourceLocation(), newMethod->getThisType(), /*IsImplicit=*/false);
clang::Expr *thisExpr = clang::CXXThisExpr::Create(
clangCtx, clang::SourceLocation(), newMethod->getThisType(),
/*IsImplicit=*/false);
if (castThisToNonConstThis) {
auto baseClassPtr =
clangCtx.getPointerType(clangCtx.getRecordType(derivedClass));