[Bug c++/11867] [3.3/3.4 Regression] static_cast ignores ambiguity
alfred dot minarik dot 1 at aon dot at
gcc-bugzilla@gcc.gnu.org
Sun Sep 7 10:28:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11867
------- Additional Comments From alfred dot minarik dot 1 at aon dot at 2003-09-07 10:28 -------
Thanks for fixing this.
And also for adding the accessibility check.
I did not report it, as I was not 100% sure about.
e.g. Comeau online test pass this without error:
(g++ now rejects it as I would have expected.)
-------
struct A {};
struct B : private A {};
int
main ()
{
B b;
A* ap = (A*) &b;
B* bp = static_cast<B*> (ap); //Error
}
---------
More information about the Gcc-bugs
mailing list