<html>
<head>
<base href="http://llvm.org/bugs/" />
</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 propagate dll attribute to already specialized template bases"
href="http://llvm.org/bugs/show_bug.cgi?id=20725">20725</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang fails to propagate dll attribute to already specialized template bases
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hans@chromium.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Consider the following example:
template <typename T> struct Template {};
template<> struct Template<int> { int foo() { return 42; } };
struct __declspec(dllexport) S : public Template<int> { };
int f(S s) {
return s.foo();
}
MSVC will export Template<int>::foo() here, because the dllexport attribute
from S gets propagated to the base class.
Clang currently fails with a warning:
d:\src\tmp\a.cc(5,41) : warning: propagating dll attribute to explicitly
specialized base class template without dll attribute is not supported
[-Wunsupported-dll-base-class-template]
struct __declspec(dllexport) S : public Template<int> { };
^
d:\src\tmp\a.cc(5,19) : note: attribute is here
struct __declspec(dllexport) S : public Template<int> { };
^
d:\src\tmp\a.cc(3,19) : note: class template 'Template<int>' was explicitly
specialized here
template<> struct Template<int> { int foo() { return 42; } };
^
Unfortunately, this does occur in real code so it would be nice if we could
support it.</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>