C++ compile -vs- errors in structure definition

Gabriel Dos Reis Gabriel.Dos-Reis@cmla.ens-cachan.fr
Thu Jan 20 09:05:00 GMT 2000


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


More information about the Gcc-bugs mailing list