ilya-biryukov wrote:

> 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.

Sure, that's obvious. I see that we access the vector by the template parameter 
index and the access is out-of-bounds.
But my question is: how does the missing call to `MarkAppeared()` leads to the 
out-of-bounds access? Do we allocate a vector that has the size of `max(Index)` 
and expect that we have previously marked all template parameters mentioned in 
the type?

> 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 :(

I have tried to turn your example into valid code and it [also 
crashed](https://gcc.godbolt.org/z/38c3dKG7b). Could we add it to the tests?
```cpp
template <class T>
class Container {};
Bar t = Foo<K<Container>>();
```


https://github.com/llvm/llvm-project/pull/85405
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to