From 5894a9138c188766e109f1d7de48c3d1fee0cec6 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 19 Dec 2011 22:12:41 +0000 Subject: Evaluation support for ExprWithCleanups. We won't evaluate any expression which actually requires non-trivial cleanups, so no cleanups need to be performed. llvm-svn: 146916 --- clang/lib/AST/ExprConstant.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/AST/ExprConstant.cpp') diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 630136ea7f8..3c2ffbd0f7b 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -1799,6 +1799,10 @@ public: { return StmtVisitorTy::Visit(E->getReplacement()); } RetTy VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *E) { return StmtVisitorTy::Visit(E->getExpr()); } + // We cannot create any objects for which cleanups are required, so there is + // nothing to do here; all cleanups must come from unevaluated subexpressions. + RetTy VisitExprWithCleanups(const ExprWithCleanups *E) + { return StmtVisitorTy::Visit(E->getSubExpr()); } RetTy VisitCXXReinterpretCastExpr(const CXXReinterpretCastExpr *E) { CCEDiag(E, diag::note_constexpr_invalid_cast) << 0; -- cgit v1.2.3