Suboptimal error message for missing typename

Gerald Pfeifer pfeifer@dbai.tuwien.ac.at
Thu May 28 14:09:00 GMT 1998


With egcs-2.91.33 19980526 the snippet

  #include <vector>

  template <class T>
  class NAMESTABLE {
    vector<T> data;
  public:
    vector<T>::reference operator[](int) {
        return data[0];
        }
    };

compiles without a hitch. Once I add the -pedantic flag I get the
correct, though not exactly helpful, error message

  x.cc:7: syntax error before `operator'


How hard would it be to make this

  x.cc:7: missing typename before type preceeding `operator'


Gerald
-- 
Gerald Pfeifer (Jerry)      Vienna University of Technology
pfeifer@dbai.tuwien.ac.at   http://www.dbai.tuwien.ac.at/~pfeifer/




More information about the Gcc-bugs mailing list