<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 --- - dllexport instantiates all member functions of all member variables of a class"
href="http://llvm.org/bugs/show_bug.cgi?id=20782">20782</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>dllexport instantiates all member functions of all member variables of a class
</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>All
</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>nicolasweber@gmx.de
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Consider:
template<class T>
class Vector {
T* elt_;
public:
void operator=(const Vector<T>& other) {
*elt_ = *other.elt_;
}
};
class BlobDataItem {
public:
BlobDataItem() : a_(A) {}
const enum { A } a_;
};
class __declspec(dllexport) BlobData {
BlobData() {}
Vector<BlobDataItem> elts;
};
Builds fine normally:
hummer:llvm-build thakis$ bin/clang -c test.cc -std=c++11
test.cc:16:18: warning: __declspec attribute 'dllexport' is not supported
[-Wignored-attributes]
class __declspec(dllexport) BlobData {
^
1 warning generated.
Doesn't build with clang-cl:
hummer:llvm-build thakis$ bin/clang-cl -c test.cc
test.cc(6,11) : error: object of type 'BlobDataItem' cannot be assigned
because its copy assignment operator is implicitly deleted
*elt_ = *other.elt_;
^
test.cc(16,29) : note: in instantiation of member function
'Vector<BlobDataItem>::operator=' requested here
class __declspec(dllexport) BlobData {
^
test.cc(13,20) : note: copy assignment operator of 'BlobDataItem' is
implicitly deleted because field 'a_' is of const-qualified type 'const enum
(anonymous enum at test.cc:13:9)'
const enum { A } a_;
^
1 error generated.
That's because Vector::operator=() doesn't build, but as it's not used it
shouldn't matter.</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>