diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-11-07 18:45:03 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-11-07 18:45:03 +0000 |
commit | 9ff62af3aa22f383e978833409f232f5614fb26b (patch) | |
tree | ed549e69c4972c5063d665730a65fa037862b8c0 /clang/lib | |
parent | faed9c671edbf07389e304c16c2f112909bd43f7 (diff) | |
download | bcm5719-llvm-9ff62af3aa22f383e978833409f232f5614fb26b.tar.gz bcm5719-llvm-9ff62af3aa22f383e978833409f232f5614fb26b.zip |
PR17615: A delegating constructor initializer is a full-expression. Don't
forget to clean up temporaries at the end of it.
llvm-svn: 194213
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 2412facf05c..cd984a251c9 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -3623,8 +3623,11 @@ static bool HandleConstructorCall(SourceLocation CallLoc, const LValue &This, // If it's a delegating constructor, just delegate. if (Definition->isDelegatingConstructor()) { CXXConstructorDecl::init_const_iterator I = Definition->init_begin(); - if (!EvaluateInPlace(Result, Info, This, (*I)->getInit())) - return false; + { + FullExpressionRAII InitScope(Info); + if (!EvaluateInPlace(Result, Info, This, (*I)->getInit())) + return false; + } return EvaluateStmt(Result, Info, Definition->getBody()) != ESR_Failed; } |