anonymous struct

Patrik Weiskircher pat@icore.at
Sun Aug 24 14:50:00 GMT 2003


Hello,

I don't know if I found a bug or it should behave like that.
If you try to compile the attached file using
g++ foo.cpp -o foo
it gives you the error message:
foo.cpp:9: error: non-local function `<anonymous struct>* fe::fee()'
uses anonymous type

I tried compiling this file with Borland C++ 5.5.1, Intel C++ 7.1 and
Forte Developer 7 and it worked with all of them.

It works too if I change the
"typedef struct {"
to a
"typedef struct _Foo {"

I tested with gcc 2.95.4, gcc 3.2 and gcc 3.3.2 20030812 (Debian
prerelease) and the error appears in all of them.

Is this the correct behaviour or is it a bug in gcc?

And please include me in CC, as I'm not subscribed to the list.

Thank you,
Patrik

-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.cpp
Type: text/x-c++
Size: 164 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030824/6e455303/attachment.bin>


More information about the Gcc-bugs mailing list