diff options
Diffstat (limited to 'clang/lib/Sema/SemaCast.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaCast.cpp | 7 | 
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp index 54683e127ec..a67d1dec59e 100644 --- a/clang/lib/Sema/SemaCast.cpp +++ b/clang/lib/Sema/SemaCast.cpp @@ -1504,10 +1504,9 @@ static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,    }    if (const ReferenceType *DestTypeTmp = DestType->getAs<ReferenceType>()) { -    bool LValue = DestTypeTmp->isLValueReferenceType(); -    if (LValue && !SrcExpr.get()->isLValue()) { -      // Cannot cast non-lvalue to lvalue reference type. See the similar  -      // comment in const_cast. +    if (!SrcExpr.get()->isGLValue()) { +      // Cannot cast non-glvalue to (lvalue or rvalue) reference type. See the +      // similar comment in const_cast.        msg = diag::err_bad_cxx_cast_rvalue;        return TC_NotApplicable;      }  | 

