[Issue 3757] Overloading const function with overridden non-const function results in seg fault.
http://d.puremagic.com/issues/show_bug.cgi?id=3757 timon.g...@gmx.ch changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED --- Comment #7 from timon.g...@gmx.ch 2012-01-28 14:05:08 PST --- On second thought, I might be wrong. The spec states: - "Virtual functions all have a hidden parameter called the this reference, which refers to the class object for which the function is called." - "A functions in a derived class with the same name and parameter types as a function in a base class overrides that function:" If the type of the hidden parameter was included in the "parameter types" part of the second statement, no function would override another, therefore it apparently is not. Therefore the commit indeed fixed the discrepancy with the spec. I think the design should be revisited at some point to make overriding more intuitive and powerful. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3757] Overloading const function with overridden non-const function results in seg fault.
http://d.puremagic.com/issues/show_bug.cgi?id=3757 timon.g...@gmx.ch changed: What|Removed |Added Status|RESOLVED|REOPENED CC||timon.g...@gmx.ch Resolution|FIXED | --- Comment #6 from timon.g...@gmx.ch 2012-01-28 13:21:17 PST --- (In reply to comment #2) > This is an undiagnosed error. Both Derived.f functions override Base.f. The first Derived.f overrides Base.f, the second is an additionally introduced overload. According to http://www.d-programming-language.org/function , this should not be a compile error but behave as stated in the bug report. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3757] Overloading const function with overridden non-const function results in seg fault.
http://d.puremagic.com/issues/show_bug.cgi?id=3757 Walter Bright changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3757] Overloading const function with overridden non-const function results in seg fault.
http://d.puremagic.com/issues/show_bug.cgi?id=3757 --- Comment #3 from github-bugzi...@puremagic.com 2012-01-28 00:23:19 PST --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/588feaeaee1342984f5f53be762fdbc198cd112d fix Issue 3757 - Overloading const function with overridden non-const function results in seg fault. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3757] Overloading const function with overridden non-const function results in seg fault.
http://d.puremagic.com/issues/show_bug.cgi?id=3757 --- Comment #5 from github-bugzi...@puremagic.com 2012-01-28 00:24:41 PST --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/470080a7735309b804920954b892ef615bb972de fix Issue 3757 - Overloading const function with overridden non-const function results in seg fault. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3757] Overloading const function with overridden non-const function results in seg fault.
http://d.puremagic.com/issues/show_bug.cgi?id=3757 --- Comment #4 from github-bugzi...@puremagic.com 2012-01-28 00:24:10 PST --- Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/04e632617be33cce3e92b5d48a7fa20a6ca621fb fix Issue 3757 - Overloading const function with overridden non-const function results in seg fault. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3757] Overloading const function with overridden non-const function results in seg fault.
http://d.puremagic.com/issues/show_bug.cgi?id=3757 Walter Bright changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #2 from Walter Bright 2012-01-28 00:17:42 PST --- This is an undiagnosed error. Both Derived.f functions override Base.f. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3757] Overloading const function with overridden non-const function results in seg fault.
http://d.puremagic.com/issues/show_bug.cgi?id=3757 Steven Schveighoffer changed: What|Removed |Added Keywords|spec|wrong-code Status|RESOLVED|REOPENED CC||schvei...@yahoo.com Version|2.040 |D2 Resolution|INVALID | Summary|The overload and override |Overloading const function |issue of const/immutable|with overridden non-const |member functions -2nd- |function results in seg ||fault. OS/Version|Windows |All --- Comment #1 from Steven Schveighoffer 2011-10-31 08:02:36 PDT --- This is neither invalid nor fixed. Tested in Linux 32-bit. Tested with 2.055: Base.f() Derived.f() const Derived.f() const Tested with 2.056: Base.f() Derived.f() Segmentation fault Clearly there is some invalid vtable stuff going on here. Probably was going on before, but manifested in a different way. If I remove the base class from the picture, it correctly prints out: Derived.f() Derifed.f() const Expected printout for original code should be: Base.f() Derived.f() Derived.f() const -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---