diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -12748,7 +12748,9 @@ template ExprResult TreeTransform::TransformCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) { - // Testing. + if (auto *Dtor = E->getTemporary()->getDestructor()) + SemaRef.MarkFunctionReferenced(E->getBeginLoc(), + const_cast(Dtor)); return getDerived().TransformExpr(E->getSubExpr()); }