[Issue 5299] Protected inheritance is semantically undefined.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 24 09:38:52 PDT 2011


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


Stewart Gordon <smjg at iname.com> changed:

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


--- Comment #2 from Stewart Gordon <smjg at 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: -------


More information about the Digitalmars-d-bugs mailing list