Bug 4373 – Importing class with 'auto foo()' causes DMD Bus error
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2010-06-23T03:36:00Z
Last change time
2011-02-10T12:42:43Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
soul8o8
Comments
Comment #0 by soul8o8 — 2010-06-23T03:36:56Z
// File: a.d
module a;
class A{
auto foo(){
return 0;
}
}
// File: b.d
module b;
import a;
class B : A{
}
% dmd -c a
% dmd -c b
Bus error
% dmd -c a b
% _
* Changing foo() to 'int foo()', 'static auto foo()', 'final auto foo()' or 'private auto foo()' makes it work.
* Changing foo() to 'public auto foo()' or 'const auto foo()' causes the same error.
* Moving the entire class A to the b.d-file makes it work for all cases.
(Mac OS X 10.6.4, DMD v2.047) PS. D is very nice.
Comment #1 by bugzilla — 2010-06-23T04:14:12Z
I can reproduce this on Linux.
$ dmd -c -v b
binary dmd
version v2.047
config /etc/dmd.conf
parse b
importall b
import object (/usr/local/include/d/druntime/object.di)
import a (a.d)
semantic b
semantic2 b
semantic3 b
code b
Segmentation fault
Comment #2 by braddr — 2011-02-06T15:40:19Z
Mass migration of bugs marked as x86-64 to just x86. The platform run on isn't what's relevant, it's if the app is a 32 or 64 bit app.
Comment #3 by clugdbug — 2011-02-10T12:42:43Z
This failed in DMD2.049, but works in 2.050 and 2.051.
The similar-sounding bug 5369 apparently still fails on Linux.