jcsxky wrote:

> The problem may be related to the fact that template parameter declarations 
> can have the `TranslationUnitDecl` as parent until the template (with these 
> parameters) is finally created. In the temporary phase the object 
> (`TemplateTypeParmDecl`) is found with lookup if it has the same name as an 
> other imported object. Does the crash happen if in the test code the 
> `TypeAliasTemplateDecl` is replaced with a plain `ClassTemplateDecl` or 
> `FunctionTemplateDecl`? If yes the change is needed at these import functions 
> too.


Replace `TypeAliasTemplateDecl` with `ClassTemplateDecl` or 
`FunctionTemplateDecl` has no problem and passed the test with following test 
code
```cpp
struct S;
template <typename>
class Callable {};
template <typename Callable>
int bindingFunctionVTable;
```
and
```cpp
struct S;
template <typename>
void Callable(){}
template <typename Callable>
int bindingFunctionVTable;
```
Test code seems good to current issue and the two you mentioned above can't be 
fixed with this pr. Should I abandon this pr or fix current issue only first?

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

Reply via email to