jcsxky wrote:

> I'm actually working on constraint checking for function template 
> specializations in #88963. I don't think this patch is quite right... this 
> will cause a crash if the befriended function is a member of a class template 
> specialization. Relative to the changes in #88963, I believe the correct fix 
> would be to change line 278 to:
> 
> ```c++
> if (RelativeToPrimary &&
>     (Function->getTemplateSpecializationKind() ==
>          TSK_ExplicitSpecialization ||
>      (Function->getFriendObjectKind() &&
>       !Function->getPrimaryTemplate()->getFriendObjectKind())))
>   return Response::UseNextDecl(Function);
> ```
> 
> I added a commit to #88963 which makes this change 
> ([be79079](https://github.com/llvm/llvm-project/commit/be79079507ffbd9b29683498f405dc2c32dd8ba7))
> 
> cc @erichkeane

Only when the friend function doesn't use any other new template parameters, 
i.e. their depth is equal can we skip to add the outer arguments to `MTAL`.

> this will cause a crash if the befriended function is a member of a class 
> template specialization

Could you please provide a testcase?

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

Reply via email to