cor3ntin wrote:

I've been thinking about this more.
It's likely this won't be the last time Carbon wants to evaluate some C++ unary 
type trait.

How do you feel about adding a `EvaluateUnaryTypeTrait(QualType T, TypeTrait 
Trait, SourceLocation Loc)` public function to Sema?

You can use `ASTContext::getTrivialTypeSourceInfo(T, Loc)` to get a typesource 
info and call the private, existing `EvaluateUnaryTypeTrait`.  

It's a smaller change and that would let you use any type trait in the future.

I don't think `EvaluateUnaryTypeTrait` produces diagnostics but if it does it 
would be easy to weave in a `bool Diagnose` as parameter of the existing 
function.



https://github.com/llvm/llvm-project/pull/238456
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to