<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 - CRTP failing when declspec export"
href="https://bugs.llvm.org/show_bug.cgi?id=44477">44477</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>CRTP failing when declspec export
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</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>enhancement
</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>jvapen@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>// t.cpp (c++17) <a href="https://godbolt.org/z/yCFtxo">https://godbolt.org/z/yCFtxo</a>
template<class Derived>
struct Base
{
static constexpr bool myBoolean = false;
static constexpr auto getValue() -> bool
{
return Derived::myBoolean;
}
};
struct __declspec(dllexport) Derived : Base<Derived>
{};
// Error:
C++ t.cpp: Failed
t.cpp(26,23): error: no member named 'myBoolean' in 'Derived'
return Derived::myBoolean;
~~~~~~~~~^
t.cpp(20,8): note: in instantiation of member function
'Base<Derived>::getValue' requested here
struct Base
^
t.cpp(30,47): note: in instantiation of template class 'Base<Derived>'
requested here
struct __declspec(dllexport) Derived : public Base<Derived>
^
1 error generated.
// Extra info:
- Removing the __declspec(dllexport) doesn't give the error
- Using the linux alternative __attribute__((visibility("default")))
@CompilerExplorer doesn't give the error on linux
- Most likely an issue of clang-cl only</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>