================ @@ -5138,7 +5148,11 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType, // -- Otherwise, the reference shall be an lvalue reference to a // non-volatile const type (i.e., cv1 shall be const), or the reference // shall be an rvalue reference. - if (!isRValRef && (!T1.isConstQualified() || T1.isVolatileQualified())) { + const bool CanBindLValueRef = ---------------- rnk wrote:
This boolean isn't needed if `!isRValRef`. Can you structure it as: ``` if (!isRValRef) { bool CanBindLValueRef = ... if (!CanBindLValueRef) { } } ``` ... or whatever is most readable, I just want to reduce the scope of the variable and avoid extra LangOpt checks. https://github.com/llvm/llvm-project/pull/99833 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits