http://d.puremagic.com/issues/show_bug.cgi?id=6072
Summary: [CTFE] Regression(git master): Cannot declare variable inside an 'if' condition Product: D Version: D2 Platform: Other OS/Version: Mac OS X Status: NEW Keywords: rejects-valid Severity: regression Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: kenn...@gmail.com --- Comment #0 from kenn...@gmail.com 2011-05-29 03:36:37 PDT --- Test case: --------------- static assert({ if (int x = 5) {} return true; }()); void main(){} --------------- x.d(4): Error: cannot evaluate delegate bool() { if (int x = int x = 5; , x) { } return true; } () at compile time x.d(1): Error: static assert (delegate bool() { if (int x = int x = 5; , x) { } return true; } ()) is not evaluatable at compile time --------------- This bug was introduced in commit 269a344 as a fix to bug 3688. The direct consequence is std.traits.functionAttributes is no longer usable. ------------------ import std.traits; struct S { pure int f(); } enum g = functionAttributes!(S.f); ------------------ /usr/include/phobos/std/traits.d(363): Error: cannot evaluate demangleFunctionAttributes("NaZi"c) at compile time ------------------ -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------