[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible Bug - g++ 3.4.0 and GotW #17
From: |
Paul Pluzhnikov |
Subject: |
Re: Possible Bug - g++ 3.4.0 and GotW #17 |
Date: |
27 May 2004 22:51:39 -0700 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) |
Paul Pluzhnikov <ppluzhnikov-nsp@charter.net> writes:
> The argument in the article looks bogus: after the 'B* pb4 = &d1;'
> assignment has executed, pb4 points into the 'B' sub-object of d1,
> and neither the compiler nor the runtime system has any way to tell
> that it really is part of a bigger "whole", and that this bigger
> "whole" has *another* instance of 'A', which therefore must be
> considered in determining the outcome of the dynamic_cast.
Continuing along this line of argument,
D* pd1 = dynamic_cast<D*>(pb4);
D* pd2 = static_cast<D*>(pb4);
should fail, but don't; so clearly I am out of my depth here,
and therefore will shut up :-(
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.