From 777711ba0b9ebcc3a122b3d5dcc4ff99bc69887a Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 30 May 2009 22:47:03 +0000 Subject: [PATCH] Add RemoveOutermostTemporaryBinding. Not used yet. llvm-svn: 72644 --- clang/lib/Sema/Sema.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index b2540ba2e05f..d926fa9c4bd7 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -1501,6 +1501,17 @@ public: /// it simply returns the passed in expression. OwningExprResult MaybeBindToTemporary(Expr *E); + /// RemoveOutermostTemporaryBinding - Remove and destroy the outermost + /// CXXBindToTemporaryExpr if necessary. This is used when we want to not + /// destroy a temporary when a full expression has been evaluated. + /// For example: + /// + /// const T& t = T(10, T()); + /// + /// Here the outermost T needs to be destroyed when t goes out of scope, but + /// the innermost T needs to be destroyed when the expr has been evaluated. + Expr *RemoveOutermostTemporaryBinding(Expr *E); + /// InitializationKind - Represents which kind of C++ initialization /// [dcl.init] a routine is to perform. enum InitializationKind {