https://bugs.llvm.org/show_bug.cgi?id=35772
Bug ID: 35772
Summary: Function pointer to __declspec(dllimport) function not
constant in /std:c++latest, works in /std:c++14
Product: clang
Version: 5.0
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: jva...@gmail.com
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
Created attachment 19610
--> https://bugs.llvm.org/attachment.cgi?id=19610&action=edit
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs