summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-11-01 18:57:34 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-11-01 18:57:34 +0000
commitab92b753d62d6cee8798c65275b03a8b5d385523 (patch)
treed0c87683642cee7131d74547c5a54b36dbdce1ef /clang/lib/Sema/SemaExpr.cpp
parent5e27d5e0337a0de10de6c563f03dbf58754f3d8c (diff)
downloadbcm5719-llvm-ab92b753d62d6cee8798c65275b03a8b5d385523.tar.gz
bcm5719-llvm-ab92b753d62d6cee8798c65275b03a8b5d385523.zip
Find copy constructor needed to copy an rvalue reference
c++ object into block descriptor. // rdar://9971124 llvm-svn: 143475
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 61766a88c07..d4d08703d3a 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1304,7 +1304,10 @@ static CaptureResult shouldCaptureValueReference(Sema &S, SourceLocation loc,
// Okay, we descended all the way to the block that defines the variable.
// Actually try to capture it.
QualType type = var->getType();
-
+
+ if (type->isRValueReferenceType())
+ type = type->getPointeeType();
+
// Prohibit variably-modified types.
if (type->isVariablyModifiedType()) {
S.Diag(loc, diag::err_ref_vm_type);
OpenPOWER on IntegriCloud