This is the mail archive of the gcc-patches@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]

Re: C++ PATCH: New parser


Mark,

is there any chance we can get better diagnosis for code like the
following?

  % cat x.cc
  #include <vector>

  using namespace std;

  template <class T>
  class TCONJUNCTION
      {
      typedef int const_iterator;
  public:
      void get()
          {
          unsigned next_var = 0;

          for( TCONJUNCTION<T>::const_iterator i = 1; // line 14
               i != 10;
               i++ )
              { }
          }
      };

  % gccvs x.cc
  x.cc: In member function `void TCONJUNCTION<T>::get()':
  x.cc:14: error: expected `;'

This is a case where the old parser did not require typename, and
the error message is quite confusing for the casual C++ hacker.

Gerald


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