summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-06 22:04:06 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-06 22:04:06 +0000
commit53e191ed948cf2307b011cdf019ceb2bfdb39e75 (patch)
tree02b518141d8eb80b35194591663f98612511080d /clang/lib/Parse/ParseExprCXX.cpp
parent928ce72bcdd7a9be4d30691be46da3099c0fcdc4 (diff)
downloadbcm5719-llvm-53e191ed948cf2307b011cdf019ceb2bfdb39e75.tar.gz
bcm5719-llvm-53e191ed948cf2307b011cdf019ceb2bfdb39e75.zip
Properly implement the scope restriction on the NRVO for
throw-expressions, such that we don't consider the NRVO when the non-volatile automatic object comes from outside the innermost try scope (C++0x [class.copymove]p13). In C++98/03, our ASTs were incorrect but it didn't matter because IR generation doesn't actually apply the NRVO here. In C++0x, however, we were moving from an object when in fact we should have copied from it. Fixes PR10142 / <rdar://problem/9714312>. llvm-svn: 134548
Diffstat (limited to 'clang/lib/Parse/ParseExprCXX.cpp')
-rw-r--r--clang/lib/Parse/ParseExprCXX.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index 6822681c7a2..b32eeda2427 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -787,12 +787,12 @@ ExprResult Parser::ParseThrowExpression() {
case tok::r_brace:
case tok::colon:
case tok::comma:
- return Actions.ActOnCXXThrow(ThrowLoc, 0);
+ return Actions.ActOnCXXThrow(getCurScope(), ThrowLoc, 0);
default:
ExprResult Expr(ParseAssignmentExpression());
if (Expr.isInvalid()) return move(Expr);
- return Actions.ActOnCXXThrow(ThrowLoc, Expr.take());
+ return Actions.ActOnCXXThrow(getCurScope(), ThrowLoc, Expr.take());
}
}
OpenPOWER on IntegriCloud