[clang] [clang] Fix loss of `dllexport` for exported template specialization (PR #93302)

via cfe-commits cfe-commits at lists.llvm.org
Wed May 29 07:40:20 PDT 2024


https://github.com/zmodem requested changes to this pull request.

> The import of a definition/specialization is already a bit of an anomaly, so dropping dllimport is probably reasonable.

Well, you're exporting a specialization. How is it going to get imported?

Perhaps me leaving the definition in there was unnecessary. How about just:

```
template<>
bool __declspec(dllimport) s::f<true>();
```
(https://godbolt.org/z/nqE7zPWYP)

Anyway, my point is that your patch is only working around half the bug. It seems to me that the proper fix has to be to get the attributes right in the AST.

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


More information about the cfe-commits mailing list