[xsd-users] Deprecated user defined copy constructor

Dirven M (Marc) marc.dirven at intraffic.nl
Wed Jun 7 07:59:07 EDT 2023


Hi,


Recently, we upgraded to GCC-12 and GCC-12 found a warning in generated code by xsdcxx. However, warnings are considered an error in our project. The warning is as follows:
One of the classes created by xsdcxx contains a user defined copy constructor. Hoewever, as of C++11, the generation of implicitly-defined copy constructor is deprecated if T has a user-defined destructor or user-defined cop assignment operator (which is the case here).  This will cause the following error:

error: implicitly-declared ‘A::B& A::B::operator=(const A::B&)’ is deprecated [-Werror=deprecated-copy]
[build]   193 |     some_var = *some_other_var;

Is there a fix for this? I have tried several things including the suppression of this warning using —[ h | cxx ]-[ pro | epi ]logue using #pragma GCC diagnostic ignored "-Wdeprecated-copy"


Kind regards,



Marc Dirven

Programmeur PRL



[cid:6e61a79a-287b-4d89-807b-74908643a60c]





E    marc.dirven at intraffic.nl<mailto:marc.dirven at intraffic.nl>

M   +31 (0)6 43 61 64 97

P    +31 (0)6 36 39 94 83

W   intraffic.nl<https://www.intraffic.nl/>



[Afbeelding met tekening, bord  Automatisch gegenereerde beschrijving]<https://www.linkedin.com/company/intraffic>[cid:3ba0582a-4fb7-43ec-9d0b-9a6bc04417af]<https://twitter.com/InTrafficNL> [cid:bc094904-4c4b-404c-ba87-a8a00a422c27] <https://www.youtube.com/channel/UCPQeh0v2U2v2hBRlNFXNY9A>  [cid:931cd7ba-1190-4105-a0ef-641836123ed0] <https://www.facebook.com/InTrafficNL/>



Visiting address: Iepenhoeve 11, 3438 MR Nieuwegein

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-d3l4rxnk
Type: image/jpg
Size: 132361 bytes
Desc: Outlook-d3l4rxnk
Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20230607/33830288/Outlook-d3l4rxnk-0001.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-pglhconf.png
Type: image/png
Size: 276 bytes
Desc: Outlook-pglhconf.png
Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20230607/33830288/Outlook-pglhconf-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-Afbeelding.png
Type: image/png
Size: 738 bytes
Desc: Outlook-Afbeelding.png
Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20230607/33830288/Outlook-Afbeelding-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-amzlx35l.png
Type: image/png
Size: 760 bytes
Desc: Outlook-amzlx35l.png
Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20230607/33830288/Outlook-amzlx35l-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-za14f1fn.png
Type: image/png
Size: 685 bytes
Desc: Outlook-za14f1fn.png
Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20230607/33830288/Outlook-za14f1fn-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-jcqwb22w.png
Type: image/png
Size: 639 bytes
Desc: Outlook-jcqwb22w.png
Url : https://codesynthesis.com/pipermail/xsd-users/attachments/20230607/33830288/Outlook-jcqwb22w-0001.png


More information about the xsd-users mailing list