------- Additional Comments From igodard at pacbell dot net  2005-07-22 01:25 
-------
Then Andrew's test case is not showing the problem. In the original, although
the message is the same as Andrew's, the line/file reference is deep inside a
system include that contains the first program text after the point of error:

In file included from
/mnt/export/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/cstddef:48,
                 from /home/ivan/ootbc/common/include/comtype.hh:6,
                 from ../../members/include/opClock.hh:4,
                 from opClock.cc:2:
/mnt/export/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/include/stddef.h:151:
error: expected constructor, destructor, or type conversion before string 
constant 

The cited line in stddef.h does not contain a string constant, as the message
seems to assert. The actual error was four files away in opClock.cc, and pretty
hard to find. In Andrew's test, ithe compiler reports:

x.cc:1: error: expected constructor, destructor, or type conversion before 
string constant 

Note that here the cited line is line 1, i.e. the line where the cited string
constant appears and so Andrew's case gives the right line/file, whereas the
original does not.

If in the original the same message had given the line/file of the "string
constant" it mentions (which was the file name in what was intended to be a
#include) I'd be happy, but it doesn't.

I don't know what the difference is between the original report code and
Andrew's as far as the parser is concerned, but the location in the message in
the original is lousy while in Andrew's it's fine. I surmise that the line/file
reporting system is confused when the parser scans over an #include boundary (or
several); that happens in the original and not in Andrew's.

Ivan


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22590

Reply via email to