I am trying to use member variables of a template base class in a derived class, as in this example:
template <class dtype> struct A { int x; }; template <class dtype> struct B : public A<dtype> { void test() { int id1 = this->x;
gcc and clang are both very picky about using this variable and require either explicit visibility or explicit use of "this". With some other compilers (xlc and icc), everything works as I expected. Is this a case of xlc and icc allowing code that is not standard, or a bug in gcc and clang?
c ++ compiler-construction inheritance templates
Aaron becker
source share