id summary reporter owner description type status milestone component version severity resolution keywords cc 11286 Code in boost/endian/buffers.hpp violates old C++03 Standard Sergey.Sprogis@… Beman Dawes "1. Description of the failure. endian/test/endian_in_union_test.cc fails with Oracle Studio C++ compiler on Solaris producing bunch of similar error message similar shown below:: ""CC"" -KPIC -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I""../../.."" -o ""../../../bin.v2/libs/endian/test/endian_in_union_test.test/sun/release/stdlib-sun-stlport/threading-multi/endian_in_union_test.o"" ""endian_in_union_test.cpp"" ""endian_in_union_test.cpp"", line 77: Error: A union member cannot have a user-defined assignment operator. 2. Cause of the failure. The failure can be demonstrated with 4 lines small independent t.cpp test: class endian_buffer { endian &endian_buffer = (int val); }; union U { endian_buffer m; }; CC -c t.cpp ""t.cc"", line 4: Error: A union member cannot have a user-defined assignment operator. Small test above has been extracted and slightly modified from the code shown below located under boost/endian/buffers.hpp template class endian_buffer< order::big, T, n_bits, align::no > { .... endian_buffer & operator=(T val) BOOST_NOEXCEPT // Line 358 C++03 Standard explicitly rejects the use of classes with user-defined assignment operators in unions: C++2003 9.5 [class.union]p1 An object of a class with a ... non-trivial copy assignment operator (13.5.3, 12.8) cannot be a member of a union. In C++11 the code is valid, as a result of apply ""Unrestricted Unions"" feature. But since it is a C++11 feature, it should not affect C++03 compilation. Seems like g++ has a bug here compiling this code successfully in both C++03 and C++11 mode. " Bugs closed To Be Determined endian Boost 1.58.0 Problem invalid Aparna.Kumta@…