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] No error given for derived-to-inaccessible-base conversion in default arg.



------- Comment #2 from widman at gimpel dot com  2006-10-03 16:38 -------
Ok, here's something that's a little closer to the original example: 

class A; 
class B;

extern B b; 

struct C  { 
    static int f( A& = b); // ERROR
};

class A{};
class B : public A {};

int n = C::f();

Failing to report this error doesn't appear to lead to a "real" bug, but it's
still ill-formed, so when you try to port your code to a compiler with the EDG
front end, you'll get:

error: a reference of type "A &" (not const-qualified) cannot
          be initialized with a value of type "B"
      static int f( A& = b); // ERROR
                         ^


-- 


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]