This is the mail archive of the gcc-bugs@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++ compile -vs- errors in structure definition


Tom Tromey <tromey@cygnus.com> writes:

[...]

| If I compile this, I expect to get an error about the use of `func2'
| in the `the_ts' structure.  I do get such an error, but the line
| number is wrong:
| 
|     creche. g++ -fsyntax-only foo.cc 
|     foo.cc:16: cannot convert `int (*) (int)' to `int (*) ()' in initialization
| 
| I expect line 14 and not 16.

Thanks for the report.

For the record, gcc-2.95.2 have a similar behaviour:

poivre% g++ -v; g++ -fsyntax-only 2.C                                 ~
Reading specs from /BASE/dosreis/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/specs
gcc version 2.95.2 19991024 (release)
2.C:16: initialization to `int (*)()' from `int (*)(int)'

-- Gaby

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