Bug 7524 – D1: #line __LINE__ doesn't parse

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2012-02-16T12:25:00Z
Last change time
2013-10-05T19:56:37Z
Keywords
ice
Assigned to
nobody
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2012-02-16T12:25:11Z
Two parser problems, different bugs but closely related: (A) D2-only. #line __LINE__ "y.d" crash.d(3): #line integer ["filespec"]\n expected crash.d(3): Declaration expected, not '"y.d"' But #line 7 __FILE__ works From the spec, it's not clear if this should work, or not. But it works on D1, and it worked on prehistoric D2 (D2.012, for example). (B) Doing things like: #line 47 __VERSION__ #line 888 __DATE__ causes the compiler to hang on both D1 and D2.
Comment #1 by bugzilla — 2013-10-02T22:09:21Z
Comment #2 by github-bugzilla — 2013-10-05T19:17:09Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/456890cf858d9e62efc3bef2316c0ee2699b962d fix Issue 7524 - #line __LINE__ doesn't parse on D2.020 and later https://github.com/D-Programming-Language/dmd/commit/792382a068d8a958a736f10e7bb091c1715576eb Merge pull request #2621 from WalterBright/fix7524 fix Issue 7524 - #line __LINE__ doesn't parse on D2.020 and later
Comment #3 by bugzilla — 2013-10-05T19:50:43Z
Fixed for D2.
Comment #4 by bugzilla — 2013-10-05T19:56:37Z
Although __LINE__ isn't supported in D1, it doesn't crash as reported here with 1.077.