boost::array MSVC 7.1 /GL bug

Hi, I just discovered a bug when using boost::array with MSVC 7.1. I have project with about 100 cpp files and 20.000 lines of code. It uses about a dozen different boost libraries. When I compile with the compiler option /GL (whole program optimization) then I get an internal compiler error. It is certainly a compiler bug. The option /GL is a somewhat experimental feature. The boost::array source code contains a templatized assignment operator with type conversion. If I add a regular assignment operator, then the code compiles. In fact, I get a clean /W4 build :-) I have tried to reproduce the bug in a smaller example, but with no success. Smaller projects compile just fine. I propose that the following lines be added to array.hpp: // assignment without type conversion (sometimes needed with MSVC 7.1 with option /GL) array<T,N>& operator= (const array<T,N>& rhs) { std::copy(rhs.begin(),rhs.end(), begin()); return *this; } --Johan Råde Department of Mathematics Lund University Lund, Sweden
participants (1)
-
Johan Råde