Summary: should not be able to implicitly cast to private base
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Walter Bright <> 2010-02-05 
18:05:00 PST ---
It seems I have been testing this with a buggy c++ compiler or 
can't remember what was the problem previously. I now tried with gcc 
4.4.3 and this is how D and C++ differ:


class Foo {
  void bar() {}

class Bar : private Foo {

int main() {
  Foo *a = new Bar();

test.cpp: In function ‘int main()’:
test.cpp:10: error: ‘Foo’ is an inaccessible base of ‘Bar’


module m1;

class Foo {
  public void bar() {}

class Bar : private foo {

module m2;
import m1;

void main() {
  Foo a = new Bar();;

// compiles and runs just fine
// Changing the 'Foo a = ...' into 'Bar a = ...' makes this an error

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to