[Issue 2564] CTFE: the index in a tuple foreach is uninitialized (bogus error)

2015-06-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2564

Andrei Alexandrescu  changed:

   What|Removed |Added

Version|2.023   |D2

--


[Issue 2564] CTFE: the index in a tuple foreach is uninitialized (bogus error)

2009-09-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2564


Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED




--- Comment #2 from Walter Bright   2009-09-03 
13:34:33 PDT ---
Fixed dmd 2.032

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2564] CTFE: the index in a tuple foreach is uninitialized (bogus error)

2009-08-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2564


Don  changed:

   What|Removed |Added

   Keywords||patch




--- Comment #1 from Don   2009-08-25 00:15:16 PDT ---
Actually it's nothing to do with foreach. Reduced test case shows it is use of
'enum' manifest constants. They're not getting constant-folded correctly.

int bug2564()
{
enum int Q=0;
string [2] s = ["a", "b"];
assert(s[Q].dup=="a");
return 0;
}

static int bug2564b = bug2564();

PATCH:
In interpret.c, getVarExp.
-if ((v->isConst() || v->isInvariant()) && v->init 
+if ((v->isConst() || v->isInvariant() || v->storage_class & STCmanifest)
&& v->init

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---