AlisdairM wrote:
Johan RĂ¥de wrote:
Alisdair,
Let's finish up this issue. Are you going to add the workaround that I proposed?
I believe the discussion in this thread led to the conclusion that my workaround is OK. Aggregates can not have user defined constructors, but they can have user defined assignment operators.
In that case the conclusion was wrong! Aggregates cannot have a user-declared copy-assignment operator. Notice that it is specifically the copy-assignment operator, rather than any other user-declared overloads, including member-templates that might match as a copy-assignment operator (eg, template operator taking non-const reference will match better than implicitly declared copy-assignment)
I think that's wrong (and yes, I've changed my mind several times, mostly thanks to the folks on this list!): "An aggregate is an array or a class (clause 9) with no user-declared constructors (12.1), no private or protected non-static data members (clause 11), no base classes (clause 10), and no virtual functions (10.3)." so assignment ops should be OK. However the change should be restricted to VC7.1 just to be sure.
However, what we are talking about appear to be a specific workaround for MSVC7.1. So long as MSVC also have a bug that allows user-declared copy assignment operators in aggregates, I am happy with the workaround.
What other platforms require this patch? Should we be checking for MSVC8 as well?
I checked the original test case with VC8 and gcc, and they did not need the patch. It really does appear to be VC7.1 specific.
I'll also want to update the test suite.
Yep, make sure there are tests for copy construction and assignment :-)
Not sure if this is appropriate for 1.34 or if we should hold it back on the mainline. The current release seems stalled, so I am hesitant to mess with anything that might push it back further. OTOH, the patch seems so simple ...
Borderline I guess. I don't think it's a critical bug, so maybe cvs HEAD would be the safest option? John.