[clang] [Clang][Sema] fix a bug on constraint check with template friend function (PR #90646)

Qizhi Hu via cfe-commits cfe-commits at lists.llvm.org
Wed May 1 06:19:21 PDT 2024


jcsxky wrote:

> ```c++
> template<typename T, typename U>
> concept D = sizeof(T) == sizeof(U);
> 
> template<typename T>
> struct A
> {
>     template<typename U, typename V> requires D<U, V>
>     static void f();
> };
> 
> template<typename T, typename U>
> struct B
> {
>     template<typename V>
>     struct C
>     {
>         friend void A<char>::f<T, U>();
>     };
> };
> 
> template struct B<int, int>::C<short>;
> 
> extern template void A<char>::f<int, int>(); // crash here
> ```
> 
> @jcsxky causes crash with and without this patch applied.

Thanks for your feedback! This may be another issue. clang trunk crashes with this case. 

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


More information about the cfe-commits mailing list