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

Andrew Ng via cfe-commits cfe-commits at lists.llvm.org
Fri May 31 07:01:57 PDT 2024


nga888 wrote:

> I think the "surprise" is that the latter call to `GetOrCreateLLVMFunction` is using an earlier `FunctionDecl`. Because of that, I'm thinking maybe the fix is to call `getMostRecentDecl` on it, something like:

Thanks for your time and the update. Yes, this is what I also discovered whilst debugging this issue. I also came to the same conclusion as you but when I tried using `getMostRecentDecl()` it didn't appear to work for me. Have you confirmed that this does fix this issue? I will look again, perhaps I made a mistake when trying this fix.

It was after this failure that I then started to question the whole removing of `dllexport`. I still think that this doesn't serve any useful purpose (and it isn't tested) which is why I would still favour the removal of the code.

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


More information about the cfe-commits mailing list