Bug 11179 – Infinite loop when pragma(msg) attempts to print a conflicting symbol

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-05T17:13:31Z
Last change time
2024-12-13T18:12:20Z
Assigned to
No Owner
Creator
Andrej Mitrovic
Moved to GitHub: dmd#17617 →

Comments

Comment #0 by andrej.mitrovich — 2013-10-05T17:13:31Z
----- void func(string func = __FUNCTION__)() { // oops, 'func' is also the name of the function pragma(msg, func); } void test() { func(); } ----- This makes the compiler start consuming memory without stopping. The below however is diagnosed properly: ---- void func(string func = "a")() { // oops, 'func' is also the name of the function pragma(msg, func); } void test() { func(); } ---- test.d(3): Error: function b.func!"a".func circular dependency. Functions cannot be interpreted while being compiled test.d(6): called from here: func() test.d(6): while evaluating pragma(msg, func)
Comment #1 by robert.schadek — 2024-12-13T18:12:20Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17617 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB