<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 - Function pointer to __declspec(dllimport) function not constant in /std:c++latest, works in /std:c++14"
href="https://bugs.llvm.org/show_bug.cgi?id=35772">35772</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Function pointer to __declspec(dllimport) function not constant in /std:c++latest, works in /std:c++14
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>5.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>C++
</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>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=19610" name="attach_19610" title="Reproduction">attachment 19610</a> <a href="attachment.cgi?id=19610&action=edit" title="Reproduction">[details]</a></span>
Reproduction
The following code compiles with MSVC2015 (/std:c++14), MSVC2017 (/std:c++17),
Clang-cl 5.0 /std:c++14 though fails to compile with Clang-cl 5.0
/std:c++latest (c++17)
__declspec(dllimport) int toInt(int i);
namespace {
template<int(*T)(int)>
struct A {};
}
int main(int, char **)
{
A<toInt> a{};
return 0;
}
As soon as the __declspec(dllimport) is removed, the code compiles again.
This issue seems to be the only problem we are encountering upgrading to
MSVC2017 (/std:c++17) and keeping Clang-cl as alternative for parsing.</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>