[Issue 19153] New: Symbol Undefined for mixin'd pragma(crt_constructor) on nested function
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 10 10:24:31 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19153
Issue ID: 19153
Summary: Symbol Undefined for mixin'd pragma(crt_constructor)
on nested function
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Keywords: accepts-invalid, diagnostic, link-failure
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: simen.kjaras at gmail.com
template G(){
extern(C) pragma(crt_constructor) void init(){}
}
void main(){
mixin G!(); // Line 5
init();
}
The above program compiles fine, but fails to link (Symbol Undefined
__D3foo4mainFZ8__mixin14initMFNaNbNiNfZv). The issue is pragma(crt_constructor)
is invalid for nested functions, and this is not reported when the function is
introduced in a mixin.
Expected behavior: Line 5 gives an error as if it introduced a regular nested
function marked pragma(crt_constructor) - that is:
Error: unrecognized pragma(crt_constructor)
--
More information about the Digitalmars-d-bugs
mailing list