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

Re: C++, libstdc++-v3 and, well, error messages


Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> writes:

| If you compile the following trivial snippet
| 
|   #include <vector>
|   vector<int> v;
| 
| with our current CVS sources, you'll get the following error:
| 
|   filename:2: syntax error before ';' token
| 
| Now, I know what's wrong in that snippet, but how many of our users will
| spend a lot of time tracking this down and also submit bug reports?
| 
| Perhaps we could issue a better diagnostic message?

Certainly, but that would involve contrived parser hackery which I'm
not sure we have time to invest in.  CodeSourcery announced that it
will turn the C++ parser in a recursive descent one -- which
undoubtely will allow better error diagnostics and error recovery.

Furthermore, the Subject: field seems to imply that the problem you
are reporting is related to libstdc++-v3.  The problem has nothing to
do with V3, it is entirely front-end specific as exemplified by this:

      %merlin% cat 3.C
      mystack<int> v;

      merlin% g++ -c 3.C 
      3.C:1: syntax error before ';' token

But, I agree with you that the diagnostic message could (or has to) be
improved. 

-- Gaby

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