[Issue 3757] Overloading const function with overridden non-const function results in seg fault.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 31 08:03:50 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=3757


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|spec                        |wrong-code
             Status|RESOLVED                    |REOPENED
                 CC|                            |schveiguy at 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 <schveiguy at yahoo.com> 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: -------


More information about the Digitalmars-d-bugs mailing list