https://llvm.org/bugs/show_bug.cgi?id=23542
Bug ID: 23542
Summary: dllexport on class with in-class initializers causes
error
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
$ bin/clang -target i386-pc-win32 -x c++ -c -
struct __declspec(dllexport) S {
int x = 42;
};
<stdin>:2:7: error: cannot use defaulted default constructor of 'S' within the
class outside of member functions because 'x' has an initializer
int x = 42;
^
<stdin>:1:30: note: implicit default constructor for 'S' first required here
struct __declspec(dllexport) S {
^
<stdin>:1:19: note: due to 'S' being dllexported
struct __declspec(dllexport) S {
^
1 error generated.
We're instantiating the default constructor due to the dllexport, and it
happens before we've parsed the in-class initializer.
--
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