http://llvm.org/bugs/show_bug.cgi?id=22840
Bug ID: 22840
Summary: MS ABI: dllexport default closure constructor
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
consider:
struct __declspec(dllimport) S { S(int = 3) {} };
void f() {
S s[5];
}
compiling with MSVC 2013 or 2015 yields a reference to __imp_??_FS@@QEAAXXZ
which is the default constructor closure. The default constructor closure
evaluates all the default arguments and then calls the default constructor.
Wrapping it this way makes it possible to call the "vector constructor
iterator" which MSVC employs as a code-size optimization.
If you change the dllimport to dllexport and compile with clang, no default
constructor is emitted and thus our program will not link.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs