|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.bugs - [Issue 2054] New: Const system broken on struct assignment.
http://d.puremagic.com/issues/show_bug.cgi?id=2054 Summary: Const system broken on struct assignment. Product: D Version: 2.012 Platform: PC OS/Version: Windows Status: NEW Keywords: accepts-invalid Severity: critical Priority: P1 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: brunodomedeiros+bugz gmail.com Const system broken on struct assignment: ---- ---- struct Struct { char* chptr; } void main() { char ch = 'd'; invariant Struct iStruct = {&ch}; Struct y = iStruct; // BREAKAGE *y.chptr = 'X'; // Because now we can do this } ---- ---- Like Andrei mentioned in accu-functional.pdf , such struct assignment should only be allowed if the struct refered to no mutable memory (which is not the case). -- Apr 28 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2054 ------- Comment #1 from simen.kjaras gmail.com 2008-04-28 19:07 ------- (In reply to comment #0) Apr 28 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2054 ------- Comment #2 from brunodomedeiros+bugz gmail.com 2008-04-28 20:54 ------- (In reply to comment #1)(In reply to comment #0) Apr 28 2008
|