Bug 8393 – class in lambda causes linker trouble

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2012-07-16T00:00:00Z
Last change time
2016-08-31T09:31:17Z
Assigned to
nobody
Creator
ellery-newcomer

Comments

Comment #0 by ellery-newcomer — 2012-07-16T00:00:56Z
dmd 2.059. code: template isAllocator(A) { enum bool isAllocator = is(typeof({ A a; static class C {} C c = a.create!C; // <- comment out and no undefined references })); } struct GCAllocator { C create(C, )() { return new C; } } pragma(msg,isAllocator!GCAllocator); void main(){} fireworks: all.o: In function `_D3all11GCAllocator68__T6createTC3all36__T11isAllocatorTS3all11GCAllocatorZ9__lambda1M1CZ6createMFZC3all36__T11isAllocatorTS3all11GCAllocatorZ9__lambda1M1C': all.d:(.text._D3all11GCAllocator68__T6createTC3all36__T11isAllocatorTS3all11GCAllocatorZ9__lambda1M1CZ6createMFZC3all36__T11isAllocatorTS3all11GCAllocatorZ9__lambda1M1C+0x37): undefined reference to `_D3all36__T11isAllocatorTS3all11GCAllocatorZ9__lambda1MFNaNbNfZv1C7__ClassZ' collect2: ld returned 1 exit status --- errorlevel 1
Comment #1 by yebblies — 2013-11-25T06:05:06Z
Works for me on win32. Can anyone reproduce on linux?
Comment #2 by ellery-newcomer — 2013-11-25T17:17:41Z
(In reply to comment #1) > Works for me on win32. Can anyone reproduce on linux? still seeing it on fedora 64bit, dmd 2.064
Comment #3 by hsteoh — 2014-01-19T20:32:31Z
Happens on git HEAD, Debian/64bit.
Comment #4 by kekeniro2 — 2014-01-19T23:10:49Z
Also on Windows, 'dmd -m32 -g' reproduces it. Without -g, it works.
Comment #5 by greeenify — 2016-08-31T09:31:17Z
works with with 2.071.1 (-> closing) - please reopen if you still have this issue.