← Back to index
|
Original Bugzilla link
Bug 19176 – Dmd crashes because of __traits(getUnitTests)
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-08-17T07:59:59Z
Last change time
2018-08-24T12:33:18Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Anton Fediushin
Comments
Comment #0
by fediushin.anton — 2018-08-17T07:59:59Z
Test case: ``` void main() { __traits(getUnitTests, foo); } template foo() { static if(true) { enum bar; } else { enum bar; } } ``` Results in: ``` $ dmd -v -c -unittest foo.d predefs DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC unittest assert D_HardFloat binary dmd version v2.081.2 config /etc/dmd.conf DFLAGS -I/usr/include/dlang/dmd -L-L/usr/lib -L--export-dynamic -fPIC parse foo importall foo import object (/usr/include/dlang/dmd/object.d) semantic foo entry main foo.d semantic2 foo semantic3 foo foo.d(6): Error: static if conditional cannot be at global scope zsh: segmentation fault (core dumped) dmd -v -c -unittest foo.d ```
Comment #1
by slavo5150 — 2018-08-18T03:30:13Z
Attempted fix:
https://github.com/dlang/dmd/pull/8574
Comment #2
by github-bugzilla — 2018-08-24T12:33:16Z
Commits pushed to master at
https://github.com/dlang/dmd
https://github.com/dlang/dmd/commit/5eab3c11e253c97061f7f37e9507ff4bb2a9bd35
Fix Issue 19176 - Dmd crashes because of __traits(getUnitTests)
https://github.com/dlang/dmd/commit/8e8a84c2be8f51319e28c228910fb9bc216b48e1
Merge pull request #8574 from JinShil/fix_19176 Fix Issue 19176 - Dmd crashes because of __traits(getUnitTests) merged-on-behalf-of: Jacob Carlborg <
[email protected]
>