This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/29332] New: No error given for derived-to-private-base conversion in default arg.


For the following case: 

// line 1
class A {};
class B : private A { };

extern B b;

void f( A & = b); // ERROR

A & a = b; // ERROR

... g++ issues only one error:

t.cpp:9: error: 'A' is an inaccessible base of 'B'

... but it should also complain about the default arg.

Incidentally, this example was boiled down from code in a real project.


-- 
           Summary: No error given for derived-to-private-base conversion in
                    default arg.
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: widman at gimpel dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29332


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]