[Issue 2947] Array literal changeable if part of class.

2017-08-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2947

anonymous4  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=11107

--


[Issue 2947] Array literal changeable if part of class.

2017-08-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2947

anonymous4  changed:

   What|Removed |Added

   Keywords||accepts-invalid, spec
URL||https://dlang.org/spec/clas
   ||s.html#constructors
   Hardware|x86 |All
 OS|Linux   |All

--- Comment #15 from anonymous4  ---
Applicable to static variables too. Probably breaks @safety.

--


[Issue 2947] Array literal changeable if part of class.

2017-08-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2947

anonymous4  changed:

   What|Removed |Added

 CC||floating.po...@rambler.ru

--- Comment #14 from anonymous4  ---
*** Issue 13646 has been marked as a duplicate of this issue. ***

--


[Issue 2947] Array literal changeable if part of class.

2016-03-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2947

--- Comment #13 from yebblies  ---
(In reply to Jakob Ovrum from comment #12)
> (In reply to yebblies from comment #11)
> > Well, you're wrong.  It should not be shared between class instances at all.
> 
> It would be consistent with every other static initializer in the language.
> If you're going to take a stand please provide some kind of rationale,
> otherwise surely the exercise is just meaningless noise.

I have no idea why you think that two class instances automatically sharing
mutable state is intentional.  There's plenty of discussion in the duplicates
of this bug.

--


[Issue 2947] Array literal changeable if part of class.

2016-03-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2947

--- Comment #12 from Jakob Ovrum  ---
(In reply to yebblies from comment #11)
> Well, you're wrong.  It should not be shared between class instances at all.

It would be consistent with every other static initializer in the language. If
you're going to take a stand please provide some kind of rationale, otherwise
surely the exercise is just meaningless noise.

--


[Issue 2947] Array literal changeable if part of class.

2016-03-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2947

--- Comment #11 from yebblies  ---
(In reply to Jakob Ovrum from comment #9)
> (In reply to yebblies from comment #8)
> > How exactly would putting the array in TLS fix this bug?
> 
> Sigh, like I said, the code in the bug report is *not* a bug.
> 

Well, you're wrong.  It should not be shared between class instances at all.

--


[Issue 2947] Array literal changeable if part of class.

2015-12-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2947

--- Comment #10 from Jakob Ovrum  ---
(In reply to Jakob Ovrum from comment #9)
> (In reply to yebblies from comment #8)
> > How exactly would putting the array in TLS fix this bug?
> 
> Sigh, like I said, the code in the bug report is *not* a bug.

That said, as has been suggested in the case of class types, it might be a
sensible solution to disallow mutable types in these cases, in which case it's
"accepts invalid".

--


[Issue 2947] Array literal changeable if part of class.

2015-12-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2947

--- Comment #9 from Jakob Ovrum  ---
(In reply to yebblies from comment #8)
> How exactly would putting the array in TLS fix this bug?

Sigh, like I said, the code in the bug report is *not* a bug.

I mention TLS because one of the "duplicates" correctly identify this as an
issue.

--


[Issue 2947] Array literal changeable if part of class.

2015-12-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2947

--- Comment #8 from yebblies  ---
(In reply to Jakob Ovrum from comment #7)
> (In reply to Georg Wrede from comment #0)
> > ...
> 
> Member field initializers are always evaluated at compile-time so this
> behaviour is not a bug. The bug is that the array elements are allocated in
> global memory instead of TLS. Only `immutable` and `shared` elements should
> be allocated in global memory. We can also do it for `const` elements as
> CTFE should always be pure enough to assume uniqueness.
> 
> Same issue as CT initializers of mutable class type, i.e.
> 
> void main()
> {
> static Object o = new Object; // stored in global memory; should be TLS
> }

How exactly would putting the array in TLS fix this bug?

--


[Issue 2947] Array literal changeable if part of class.

2015-12-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2947

Jakob Ovrum  changed:

   What|Removed |Added

 CC||jakobov...@gmail.com

--- Comment #7 from Jakob Ovrum  ---
(In reply to Georg Wrede from comment #0)
> ...

Member field initializers are always evaluated at compile-time so this
behaviour is not a bug. The bug is that the array elements are allocated in
global memory instead of TLS. Only `immutable` and `shared` elements should be
allocated in global memory. We can also do it for `const` elements as CTFE
should always be pure enough to assume uniqueness.

Same issue as CT initializers of mutable class type, i.e.

void main()
{
static Object o = new Object; // stored in global memory; should be TLS
}

--


[Issue 2947] Array literal changeable if part of class.

2013-11-21 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=2947


yebblies  changed:

   What|Removed |Added

 CC||c...@dawg.eu


--- Comment #6 from yebblies  2013-11-22 02:53:57 EST ---
*** Issue 10108 has been marked as a duplicate of this issue. ***

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


[Issue 2947] Array literal changeable if part of class.

2013-11-20 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=2947


yebblies  changed:

   What|Removed |Added

 CC||yebbl...@gmail.com


--- Comment #5 from yebblies  2013-11-20 22:45:58 EST ---
Similar thing for classes in issue 11107

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


[Issue 2947] Array literal changeable if part of class.

2013-06-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2947



--- Comment #4 from Caligo  2013-06-21 08:58:32 PDT ---
How many years before this is fixed, god damn.

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


[Issue 2947] Array literal changeable if part of class.

2013-06-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2947


Nils  changed:

   What|Removed |Added

 CC||iteronve...@gmail.com


--- Comment #3 from Nils  2013-06-20 07:39:15 PDT 
---
*** Issue 10423 has been marked as a duplicate of this issue. ***

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


[Issue 2947] Array literal changeable if part of class.

2012-02-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2947


yebblies  changed:

   What|Removed |Added

 CC||dsim...@yahoo.com


--- Comment #2 from yebblies  2012-02-02 14:29:15 EST ---
*** Issue 4378 has been marked as a duplicate of this issue. ***

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


[Issue 2947] Array literal changeable if part of class.

2009-05-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2947





--- Comment #1 from g...@nwawudu.com  2009-05-07 03:32 ---
*** Bug 2948 has been marked as a duplicate of this bug. ***


--