diff options
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 61766a88c0..d4d08703d3 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/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); |