<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - clang fails to make visible explicit template instantiation."
href="https://bugs.llvm.org/show_bug.cgi?id=38724">38724</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang fails to make visible explicit template instantiation.
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jz.maddock@googlemail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=20779" name="attach_20779" title="Preprocessed source to reproduce the issue.">attachment 20779</a> <a href="attachment.cgi?id=20779&action=edit" title="Preprocessed source to reproduce the issue.">[details]</a></span>
Preprocessed source to reproduce the issue.
We have a problem in Boost.Regex where compiling with clang++
-fvisibility=hidden results in certain explicit template instantiations not
being visible from the final shared library - while the same code with g++ is
just fine. Further more the template instances are marked "W" in the object
file, yet somehow still end up being hidden in the final .so regardless of
whether g++ or clang++ is used as the linker.
I've tried pretty hard to boil this down to a simple test case - but miserably
failed as all the simple cases work as expected. So the attached test case is
our code pre-processed with g++, and can then be compiled with either g++ or
clang.
To reproduce, build with:
clang++ -fvisibility=hidden -DBOOST_REGEX_DYN_LINK -shared -I../../.. -fPIC -o
t.so instances-gcc-pp.cpp
Or
g++ -fvisibility=hidden -DBOOST_REGEX_DYN_LINK -shared -I../../.. -fPIC -o
t.so instances-gcc-pp.cpp
Then:
nm -D t.so
And search for "maybe_assign" - the g++ compiled .so will have two such
records, while clang++ has none.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>