<html>
<head>
<base href="https://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 --- - dllexport vs template instantiation, nested class, and in-class initialization"
href="https://llvm.org/bugs/show_bug.cgi?id=26076">26076</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>dllexport vs template instantiation, nested class, and in-class initialization
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>-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>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>From crbug.com/575700:
struct LayerSelectionBound;
template <typename> struct Selection {};
typedef Selection<LayerSelectionBound> LayerSelection;
struct LayerImpl;
struct __declspec(dllexport) LayerTreeImpl {
struct __declspec(dllexport) ElementLayers {
LayerImpl *main = nullptr;
};
LayerSelection foo;
};
$ bin/clang -target i686-pc-win32 -c /tmp/a.cc
/tmp/a.cc:8:16: error: cannot use defaulted default constructor of
'ElementLayers' within 'LayerTreeImpl' outside of member functions because
'main' has an
initializer
LayerImpl *main = nullptr;
^
/tmp/a.cc:10:18: note: in instantiation of template class
'Selection<LayerSelectionBound>' requested here
LayerSelection foo;
^
/tmp/a.cc:7:32: note: implicit default constructor for
'LayerTreeImpl::ElementLayers' first required here
struct __declspec(dllexport) ElementLayers {
^
/tmp/a.cc:7:21: note: due to 'ElementLayers' being dllexported
struct __declspec(dllexport) ElementLayers {
^
1 error generated.
PR23542 was the bug for dllexport vs in-class initializers in general.</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>