[clang] [llvm] Add support for template as type parameter (PR #127654)

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 11 13:24:11 PDT 2025


dwblaikie wrote:

> Are you suggesting that for the implementation to be considered as complete, both v1 and v2 should have the same type information? I.e "v1" type should point to 0x48 instead of 0x6d? As per my understanding based on the DWARF output below, the type for "trait::type"(0x6d) DOES reference a DW_TAG_template_type_parameter(0x67) entry:

No, I don't think it should point to 0x67 instead of 0x6d - you could imagine a trait with a resulting type that has nothing to do with T (like `std::conditional_v<T, bool, char>`).

My contention is that DWARF doesn't have a way to express this - and I don't really have a good idea for novel solutions/additions to DWARF etc to handle this. And without that, only changing the raw `T` references is of limited value.

That's why I don't think this is a great direction to go.

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


More information about the cfe-commits mailing list