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

Ross Kirsling via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 24 12:02:53 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 {
----------------
rkirsling wrote:

Oh, sure. No worries!

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


More information about the cfe-commits mailing list