zmodem wrote:

> I understand that removing the code that drops `dllexport` may not be the 
> "best" place to fix this issue but if this code is not actually required, 
> which appears to be the case (please let me know if this is not), then 
> removing the code to achieve "better" behaviour feels like a "win". The 
> alternative would be to add more code/complexity to the AST handling.

I still think fixing the AST would be better. That would also fix the 
"dllimport version" of your test case:

```
struct s {
  template <bool b = true> static bool f();
};
template <typename T> bool template_using_f(T) { return s::f(); }
bool use_template_using_f() { return template_using_f(0); }

template<> inline
bool __declspec(dllimport) s::f<true>() { return true; }
```

Here, `dllimport` gets dropped from `s::f<true>()` for the same reason as in 
your test: the AST node which the call in `template_using_f()` refers to is 
missing the attribute. (Godbolt: https://godbolt.org/z/nnfET4r13)

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

Reply via email to