Bug 20626 – ICE when using typeof of unittest symbol without -unittest flag
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-03-02T18:40:21Z
Last change time
2020-05-15T19:51:23Z
Keywords
ice-on-invalid-code, pull
Assigned to
No Owner
Creator
Mathias LANG
Comments
Comment #0 by pro.mathias.lang — 2020-03-02T18:40:21Z
```
unittest {}
pragma(msg, typeof(__unittest_L1_C1));
```
Compile with `dmd test.d` and you get a segv. Compile with `dmd -unittest test.d` and it works just fine.
Tested with DMD v2.090.1 & madteer as of 2020-03-03.
Found while working on https://github.com/dlang/dmd/pull/10834
Comment #1 by moonlightsentinel — 2020-03-02T20:53:26Z
Digger:
commit 081494aaf8251f37dc08960d40bfb159968ed729
Author: The Dlang Bot <[email protected]>
Date: Fri Feb 2 00:16:54 2018 +0100
dmd: Merge pull request #7761 from atilaneves/fix_18097
https://github.com/dlang/dmd/pull/7761
Fix issue 18097 - unittest symbol names can be used before semantic
merged-on-behalf-of: Iain Buclaw <[email protected]>
Comment #2 by moonlightsentinel — 2020-05-15T10:24:54Z
What should typeof(__unittest_L1_C1) return, the actual function type or _error_?
Comment #3 by moonlightsentinel — 2020-05-15T10:29:42Z
(In reply to moonlightsentinel from comment #2)
> What should typeof(__unittest_L1_C1) return, the actual function type or
> _error_?
Or void?
Comment #4 by dlang-bot — 2020-05-15T11:03:46Z
@MoonlightSentinel created dlang/dmd pull request #11145 "Fix Issue 20626 - ICE when using typeof of unittest symbol without -u…" fixing this issue:
- Fix Issue 20626 - ICE when using typeof of unittest symbol without -unittest flag
https://github.com/dlang/dmd/pull/11145
Comment #5 by dlang-bot — 2020-05-15T19:51:23Z
dlang/dmd pull request #11145 "Fix Issue 20626 - ICE when using typeof of unittest symbol without -u…" was merged into stable:
- 71ce029a48caf897c463df0513f713af88eb42ed by MoonlightSentinel:
Fix Issue 20626 - ICE when using typeof of unittest symbol without -unittest flag
https://github.com/dlang/dmd/pull/11145