Wolfgang Bangerth wrote:

I understand that you are talking about ISO C, but one relevant case (in C++) to look out for that is similar is this one, which certainly constitutes legitimate and widespread use of language features:

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

  void f() {
    B b;
    g (static_cast<A*> (&b));
  }

  void g(A *a) {
    B *b = dynamic_cast<B*>(a);
    // do what you please with the full object B
  }

Yes, it was this example that is at the root of the whole thread. Everyone is agreed that in C++, when the "field" is in fact a base class, we must make the conservative assumption.


--
Mark Mitchell
CodeSourcery, LLC
[EMAIL PROTECTED]
(916) 791-8304

Reply via email to