dependent scope expr weirdness

template <typename T>
struct s {
  s() {
    T::x = 0;
  }
};

template <typename T>
void f() {
  T::x = 0;
}

In this snippet the first x is mapped to a CXXDependentScopeMemberExpr
while the second is mapped to a CXXDependentScopeDeclRefExpr.

There is a reason underlying this incongruency?

Yes. T::x within the non-static member function might be a reference to a non-static member of a base class 'T', which would be an access with an implicit 'this'. We don't know until instantiation time.

  - Doug

Not in this specific case, but in general this might happen.

Thanks for explaining.