[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 24 11:59:34 PDT 2025


================
@@ -1725,14 +1725,15 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT,
 
     // Build expressions that emulate the effect of declval<T>() and
     // declval<U>().
-    if (LhsT->isObjectType() || LhsT->isFunctionType())
-      LhsT = Self.Context.getRValueReferenceType(LhsT);
-    if (RhsT->isObjectType() || RhsT->isFunctionType())
-      RhsT = Self.Context.getRValueReferenceType(RhsT);
-    OpaqueValueExpr Lhs(KeyLoc, LhsT.getNonLValueExprType(Self.Context),
-                        Expr::getValueKindForType(LhsT));
-    OpaqueValueExpr Rhs(KeyLoc, RhsT.getNonLValueExprType(Self.Context),
-                        Expr::getValueKindForType(RhsT));
+    auto createOpaqueExpr = [&](QualType Ty) -> OpaqueValueExpr {
----------------
erichkeane wrote:

Ah, shoot... a better name looking at the comment is `createDeclValExpr`.  Sorry, i should have suggested that in the 1st place.  

https://github.com/llvm/llvm-project/pull/144836


More information about the cfe-commits mailing list