[C++20] [Modules] Emit full specialization of variable template as available...
[C++20] [Modules] Emit full specialization of variable template as available externally in importers Closes https://github.com/llvm/llvm-project/issues/59780. In this issue report, when we use full specialization of variable templates in modules, we will meet the multiple definition errors. The root cause of the problem is that when we see the full specialization of the variable template in the importers, we will find if it is already defined in the external sources and we failed to find such definitions from external sources. So we generate the definition in the current TU. We failed to find the definition in the external sources because we restricted to not write it during writing. However, we don't know why we restricted it and it doesn't make a lot sense to do such restriction. Then no test fails after we remove such limitations. So let's remove it now and add it back later if we found it is necessary then we can add the corresponding test that time. Note that the code is only applied to named modules and PCHWithObjectFiles. So it won't affect the normal clang modules and header units.
Loading
Please sign in to comment