[clang] [clang] CTAD: Track template template type parameters that referenced in (PR #85405)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 20 06:46:34 PDT 2024


hokein wrote:

> The change seems to be correct in the way code is written.
> 
> However, I wonder what's the connection between the crash and the function being changed? Is there a way to fail gracefully if there are more mistakes in this function for incorrect code (e.g. fail deduction instead of crashing)?
> 
> Is this also a correctness issue? Is it possible to come with an example where the correct code causes a crash? (I suspect there is, we should probably add it in as well as this is more severe than crashes on incorrect code).

This issue comes from a bug in the implementation where we missed to handle the template template parameter. The resulting crash is a manifestation of this problem.

I think it also affect correct code, I tried to come up with such example (which triggers the CTAD on template template parameters), but no luck :(

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


More information about the cfe-commits mailing list