http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50248

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-08-31 
10:24:07 UTC ---
Thanks for not posting an example of 30k lines :)


another workaround is to add these constructors:

    MapSessionData(const MapSessionData&) = delete;
    MapSessionData() = default;


The error does not come from failing to use the default constructor, it comes
from the implicit-definition of the MapSessionData copy constructor.

[class.copy]/8 says:

- earray has an implicitly-declared copy-constructor of the form earray(const
earray&),
- MapSessionData has an implicitly-declared copy constructor of the form
MapSessionData(MapSessionData&) because its base class has a copy-constructor
taking a non-const parameter.

The implicitly-declared MapSessionData(MapSessionData&) copy-ctor should only
be implicitly-defined if it is odr-used (p13) so I'm not sure why it is, but
that implicit definition attempts to initialize equip_index with a non-const
parameter, which selects the variadic template because the earray(const earray)
constructor is not viable.

(The workaround above prevents the implicit-declaration of the MapSessionData
copy-ctor, so it doesn't attempt to use the variadic template.)


Jason, is it correct that the copy ctor is implicitly-defined?

Reply via email to