[Issue 11179] New: Infinite loop when pragma(msg) attempts to print a conflicting symbol
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Oct 5 17:13:32 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11179
Summary: Infinite loop when pragma(msg) attempts to print a
conflicting symbol
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-10-05 17:13:31 PDT ---
-----
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)
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list