[Issue 4313] undefined identifier error with scope guard statement
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jan 30 19:02:13 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4313
yebblies <yebblies at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |yebblies at gmail.com
Version|2.041 |D1 & D2
--- Comment #2 from yebblies <yebblies at gmail.com> 2012-01-31 14:02:11 EST ---
(In reply to comment #1)
> Seems a bit strange. According to CompoundStatement::semantic this is rewritten
> as try-catch-finally.
>
> Even scope(exit) would have the auto res = 0 in the try block which would
> result in undefined identifier.
Because the declaration is nothrow, main's body becomes:
{
int res = 0;
writeln(res);
return 0;
}
But yes, this is a bug.
--
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