Bug 19154 – Undefined reference to inline function in mixin template

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-08-10T14:06:27Z
Last change time
2024-12-13T19:00:13Z
Keywords
link-failure
Assigned to
No Owner
Creator
anonymous4
Moved to GitHub: dmd#17875 →

Comments

Comment #0 by dfj1esp02 — 2018-08-10T14:06:27Z
mixin template test() { pragma(inline, true) // remove this will work static int zzz() { return 0; } int dummy = zzz(); } void f() { mixin test!(); } Trying to link this code gives error: undefined reference to '_D9onlineapp1fFZ8__mixin13zzzFNbNiZi' collect2: error: ld returned 1 exit status Error: linker exited with status 1
Comment #1 by dfj1esp02 — 2018-08-10T14:12:26Z
The reason is that the function is not inlined.
Comment #2 by robert.schadek — 2024-12-13T19:00:13Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17875 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB