Topic: scope of typedef names


Author: mrice@quip.eecs.umich.edu (Michael Rice)
Date: 1995/07/21
Raw View
Take a look at the following code:

struct A {
  static int i;
};

int A::i = 0;

struct B : A {
  typedef A T;
  static int i;
};

int B::i = 1;

struct C {
  typedef int T;
};

void f(B* bp)
{
  bp->T::i = 1;  // legal?

  T::i = 1;  // definitely illegal?
}

Is the bp->T::i legal?   I assume the bp tells the compiler to find
B::T::i.  Can someone tell me what section of the WP this is covered in?

Thanks.