[Bug c/40136] New: Initializing a union whose first member is an anonymous struct
Not sure if this is a bug or a standards interpretation issue. Consider the following union, whose first member is an anonymous struct: union Foo { struct { float a,b,c; }; const char* x; }; icc (10.1) permits initialization of the first member of the union: Foo foo = { .0f, .0f, .0f }; gcc (4.0.1) doesn't permit that, but does permit the following, which I believe should not be accepted: Foo foo = { "foo" }; -- Summary: Initializing a union whose first member is an anonymous struct Product: gcc Version: 4.0.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: markleone at gmail dot com GCC host triplet: i686-apple-darwin9-gcc-4.0.1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40136
[Bug c++/41560] New: Bus error on operator[] override
I'm getting a bus error on the following override of operator[]. (Not sure if it's valid.) #include template class MyVector : public std::vector { const T& operator[](size_t n) const { return typename std::vectoroperator[](n); } }; test.cpp: In member function ‘const T& MyVector::operator[](size_t) const’: test.cpp:7: internal compiler error: Bus error -- Summary: Bus error on operator[] override Product: gcc Version: 4.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: markleone at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41560
[Bug c++/41560] Bus error on operator[] override
--- Comment #1 from markleone at gmail dot com 2009-10-03 22:01 --- The bus error disappears when it's fixed with '::' between vector and operator[] in the return statement. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41560