[llvm] [SandboxIR] Add extern templates for GlobalWithNodeAPI (PR #111940)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 13:49:42 PDT 2024


bogner wrote:

This doesn't look right - why do we instantiate each of these templates twice? I'm seeing warnings from clang-cl now since there are duplicate instantiations between `Constant.h` and `Constant.cpp`.

```
llvm/lib/SandboxIR/Constant.cpp(309,52): error: duplicate explicit instantiation of 'operator()' ignored as a Microsoft extension [-Werror,-Wmicrosoft-template]
  309 |                   llvm::GlobalObject>::LLVMGVToGV::operator()(llvm::GlobalIFunc
      |                                                    ^
llvm/include\llvm/SandboxIR/Constant.h(804,52): note: previous explicit instantiation is here
  804 |                   llvm::GlobalObject>::LLVMGVToGV::operator()(llvm::GlobalIFunc
      |                                                    ^
```

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


More information about the llvm-commits mailing list