Thread overview
[Issue 5299] New: Protected inheritance is semantically undefined.
Dec 01, 2010
Bernard Helyer
Dec 01, 2010
Jonathan M Davis
Jul 24, 2011
Stewart Gordon
Jul 24, 2011
Stewart Gordon
Sep 15, 2011
Trass3r
Jan 20, 2012
Walter Bright
December 01, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5299

           Summary: Protected inheritance is semantically undefined.
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody@puremagic.com
        ReportedBy: blood.of.life@gmail.com


--- Comment #0 from Bernard Helyer <blood.of.life@gmail.com> 2010-12-01 05:38:20 PST ---
http://www.digitalmars.com/d/2.0/class.html

Inheritance is defined by the grammar to be allowed to take this form:

    Protection Identifier

However, this is not mentioned anywhere, and the semantics are entirely undefined.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 01, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5299


Jonathan M Davis <jmdavisProg@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg@gmx.com


--- Comment #1 from Jonathan M Davis <jmdavisProg@gmx.com> 2010-12-01 10:12:07 PST ---
Well, that's exceptionally weird. It compiles too. D doesn't support any kind of inheritance but public. It seems like either it's a hold-over which was never removed (assuming that D supported private or protected inheritance in the past), or it was intended to make porting C++ code easier. But it seems to me that allowing and then ignoring (as the compiler presumably does) protection identifiers when inheriting classes is not good behavior. The fact that the compiler allows it though means that it's more than just a spec issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 24, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5299


Stewart Gordon <smjg@iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg@iname.com


--- Comment #2 from Stewart Gordon <smjg@iname.com> 2011-07-24 09:38:50 PDT ---
Looking at (In reply to comment #1)
> Well, that's exceptionally weird.  It compiles too.  D doesn't support any kind of inheritance but public.  It seems like either it's a hold-over which was never removed (assuming that D supported private or protected inheritance in the past),

According to the description and first comment on issue 177, private/protected inheritance once worked.  But it doesn't work now (1.069, 2.054).  But it never made sense to have the feature in D.

> or it was intended to make porting C++ code easier.

D was never intended to be source-compatible with C++, or even C. Consequently, such a tiny concession makes no sense at all, and even less sense considering the fundamental differences between C++ classes and D classes.

> But it seems to me that allowing and then ignoring (as the compiler presumably does) protection identifiers when inheriting classes is not good behavior.  The fact that the compiler allows it though means that it's more than just a spec issue.

Issue 177 is "Remove inheritance protection".  Essentially that has been done, but by ignoring attempts to use it rather than making it illegal.  So that issue has been reduced to this one.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 24, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5299


Stewart Gordon <smjg@iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |benoit@tionex.de


--- Comment #3 from Stewart Gordon <smjg@iname.com> 2011-07-24 09:44:36 PDT ---
*** Issue 177 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: -------
September 15, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5299


Trass3r <mrmocool@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool@gmx.de


--- Comment #4 from Trass3r <mrmocool@gmx.de> 2011-09-15 13:32:28 PDT ---
grammar part fixed in https://github.com/D-Programming-Language/d-programming-language.org/commit/55b8905dd1f251fd54a8306bc1cce353bfa0d09e

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5299


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #5 from Walter Bright <bugzilla@digitalmars.com> 2012-01-20 12:07:41 PST ---
Deprecated it:

https://github.com/D-Programming-Language/dmd/commit/3ab6ab40e457e8f32539be38b14ea3839f38d409

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