Using GCC v4.0_20041107 on FreeBSD v5.3: struct __attribute__ ((visibility("default"))) Foo { int foo; }; int main(void) { Foo foo; return 0; }
If compiled as a C++ file, all is fine. If compiled as C you get: internal compiler error: tree check: expected class 'declaration', have 'exceptional' (identifier_node) in handle_visibility_attribute, at c-common.c: 4648 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. I think it's perfectly valid for C code to mark structures as having visibility though it means nothing useful (so it could simply be ignored). It certainly shouldn't generate an internal compiler error. Cheers, Niall -- Summary: __attribute__ ((visibility("default"))) in C causes internal compiler error Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: s_gccbugzilla at nedprod dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18479