This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

dependent names in templates


Hi.
  Consider the following case :
template<typename T> struct Base{
     void f() const {}
     int X;
};

template<typename T> struct Derived : public Base<T> {
     void g() {
         X = X+X;
         f();   // LINE*
     }
};

gcc does not require to write in "line*" : "this->f()", "this->X"
But there are compilers that do require, they cannot
resolve the symbol "f()" otherwise.

 I have a portable c++ code, besides this case.
Is there some automatic way to find and correct
all occurencies of such a case in the code?

I always work with gcc, but I will
need to port the code to vendor provided
compiler soon (to sgi mipspro).

Thank you.
 Dima.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]