[clang] Moves destructor type-trait deduction to a public function (PR #238456)

Chandler Carruth via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 13:52:47 PST 2026


chandlerc wrote:

> I think i'd like to know more about the motivation. We want to keep the implementation very close to the type traits implementation - ie. this is a 1/1 mapping to `<type_traits>` - I'm not certain than avoiding the duplication is desirable.
> 
> In particular, this uses Sema because access checks are done in the context where the trait is used, which, afaik, is why we need Sema and do lookup. If we could not do that, you'd be able to skip all of that.
> 
> Can C++ befriend carbon types? Presumably that would be one scenario where this matter.

FWIW, I would definitely expect us to want to allow Carbon types in C++ friend declarations. =/ For example, if we migrate a type from C++ into Carbon that is already in friend declarations.

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


More information about the cfe-commits mailing list