================ @@ -5813,6 +5817,34 @@ static ExprResult CheckConvertibilityForTypeTraits( return Result; } +static APValue EvaluateSizeTTypeTrait(Sema &S, TypeTrait Kind, + SourceLocation KWLoc, + ArrayRef<TypeSourceInfo *> Args, + SourceLocation RParenLoc, + bool IsDependent) { + if (IsDependent) + return APValue(); + + switch (Kind) { + case TypeTrait::UTT_StructuredBindingSize: { + QualType T = Args[0]->getType(); + SourceRange ArgRange = Args[0]->getTypeLoc().getSourceRange(); + std::optional<unsigned> Size = + S.GetDecompositionElementCount(T, ArgRange.getBegin()); + if (!Size) { + S.Diag(KWLoc, diag::err_arg_is_not_destructurable) << T << ArgRange; ---------------- erichkeane wrote:
Ah, hmm... This would result in a complete-type diagnostic, followed by 'not destructurable'. I guess that is OK. https://github.com/llvm/llvm-project/pull/131515 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits