This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: PR 11687
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: mark at codesourcery dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 07 Sep 2003 06:52:40 +0200
- Subject: Re: C++ PATCH: PR 11687
- Organization: Integrable Solutions
- References: <200309070411.h874Bbxs013531@doubledemon.codesourcery.com>
Mark Mitchell <mark@codesourcery.com> writes:
| This patch fixes another regression introduced by my static_cast
| rewrite. C++ says that there exists a conversion from a derived class
| to an ambiguous class, but you aren't allowed to use it. Who knew?
Hmm, I think the wording
/* [conv.ptr]
An rvalue of type "pointer to cv D," where D is a
class type, can be converted to an rvalue of type
"pointer to cv B," where B is a base class (clause
_class.derived_) of D. If B is an inaccessible
(clause _class.access_) or ambiguous
(_class.member.lookup_) base class of D, a program
that necessitates this conversion is ill-formed. */
is meant to read "the conversion is defined everywhere except here and
there." In other words, the "conversion" in the last sentence is
designating the cast-notation. Did we parse C++ programs in their
generic forms, the issue would be crystal-clear :-/
it is like saying that the function-call is ill-formed in
struct A { };
struct B { };
void f(A) { }
int main() { B b; f(b); }
-- Gaby