This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29332] No error given for derived-to-inaccessible-base conversion in default arg.
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Oct 2006 16:45:50 -0000
- Subject: [Bug c++/29332] No error given for derived-to-inaccessible-base conversion in default arg.
- References: <bug-29332-10061@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-10-03 16:45 -------
(In reply to comment #2)
> Ok, here's something that's a little closer to the original example:
I get an error with that example:
t.cc:8: error: default argument for parameter of type ?A&? has type ?B?
In fact the following is valid code which is why we cannot error until you
actually call f:
// line 1
class A {};
class B : private A { friend void g(void);};
extern B b;
void f( A & = b); // ERROR
void g(void)
{
f();
}
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29332