<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113824>113824</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
What causes clang to produce weak external symbols for template parameter objects?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
weinig
</td>
</tr>
</table>
<pre>
I'm not 100% confident that this is clang, it might be the linkers doing, but I'm trying to figure out what the criteria is for when a symbol with the form "weak external template parameter object" is produced and if that criteria has changed over releases.
Background is that I'm attempting to use NTTPs somewhat extensively in a project (WebKit) that has a post build script that looks for symbols in the linked output (via `nm -m`) that are "weak external" (https://github.com/WebKit/WebKit/blob/main/Tools/Scripts/check-for-weak-vtables-and-externals#L80) and errors if it finds any. (I don't know the history behind the script.)
I have gotten a report from the WebKit team that on older versions of clang (I am working on getting better details from them, but so far I have "Debug Sonoma and Ventura Xcode"), this script is producing an error.
I haven't been able to figure out what exactly provokes the generation of this type of symbol and was hoping there might be something I am just overlooking. My presumption is that it has to do with some ODR, but I can't work out any details.
--
In case it is helpful, the specific symbols it generates weak external for are:
__ZTAXtlN7WebCore3CSS5RangeELd0000000000000000ELd7ff0000000000000EEE
(run through c++filt: "template parameter object for WebCore::CSS::Range{0x0p+0, inf}")
__ZTAXtlN7WebCore3CSS5RangeELdfff0000000000000ELd7ff0000000000000EEE
(run through c++filt: "template parameter object for WebCore::CSS::Range{-inf, inf}")
and the commit it triggers on is https://github.com/WebKit/WebKit/commit/4692eacc698b91686bf635d0b4e3030853edfd97
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVU2P2zgS_TX0pWBDpizJPvjQXwaCzWYX6cYm2EtAiUWJMUUKZMmO__2AouxO52Mwc5o-qNVq6dV7j_WqRAi6tYh7Vtyz4nEhRuqc359RW90uaicv-3eMVz1YR7DOMsYLaJxVWqIloE7Eiw6gAzRG2Jbx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