diff options
Diffstat (limited to 'clang/lib/Sema/SemaCXXCast.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCXXCast.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp index 50e39e0d043..d053d5a9e9f 100644 --- a/clang/lib/Sema/SemaCXXCast.cpp +++ b/clang/lib/Sema/SemaCXXCast.cpp @@ -1717,8 +1717,7 @@ Sema::CXXCheckCStyleCast(SourceRange R, QualType CastTy, ExprValueKind &VK, Kind = CK_Dependent; return Owned(CastExpr); } - - QualType origCastExprType = CastExpr->getType(); + if (VK == VK_RValue && !CastTy->isRecordType()) { ExprResult CastExprRes = DefaultFunctionArrayLvalueConversion(CastExpr); if (CastExprRes.isInvalid()) |