[xsde-users] xsd/e: Compiler warnings from copy ctor of var_const_iterator (sequence.hxx:428)

Jonathan Haws Jonathan.Haws at sdl.usu.edu
Thu Oct 29 13:38:25 EDT 2020

I'm running xsd/e version 3.2.0 (the latest from what I can tell) with
newer GCC compilers (7.5, 9,2, 9.3). I'm finding that some versions (9 and above) will give me a warning about a deprecated copy when using the following construct (GCC 7 does not give a warning):

   for (auto &c : xml.choice())

I've tracked this down to the copy constructor in sequence.hxx at line
428. Because this copy constructor exists, the compiler will issue a warning as follows:

warning: implicitly-declared ‘constexpr
xsde::cxx::hybrid::var_const_iterator<sensor::choice_type>&)’ is
deprecated [-Wdeprecated-copy]
  283 |       for (auto &choice : sensor.choice())
      |                                         ^
In file included from
                 from /opt/git/sigma/_intelbld/xmlLIB/XML/sigma-
                 from /opt/git/sigma/_intelbld/xmlLIB/XML/sigma-
                 from /opt/git/sigma/xmlLIB/XML/XmlConfig.hpp:28,
:9: note: because
‘xsde::cxx::hybrid::var_const_iterator<sensor::choice_type>’ has user-
provided ‘xsde::cxx::hybrid::var_const_iterator<T>&
var_const_iterator<T>) [with T = sensor::choice_type]’
  429 |         operator= (var_const_iterator j)
      |         ^~~~~~~~
:66: note:   initializing argument 2 of ‘bool
xsde::cxx::hybrid::var_const_iterator<T>) [with T =
  569 |       operator!= (var_const_iterator<T> i,
var_const_iterator<T> j)

The code seems to behave the same at runtime when I remove that copy
constructor and just use the compiler default (which from what I can
tell should produce nearly identical code). All versions of GCC that I have tried build properly and no issues at runtime.

Can you help me understand what is going on? Is there a newer version
of xsd/e that I can use?  If so, where do I find that because the
download page only has version 3.2.0 listed? Is there a better way to fix these warnings other than removing that ctor?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5562 bytes
Desc: not available
Url : https://codesynthesis.com/pipermail/xsde-users/attachments/20201029/b1ae11d4/smime.bin

More information about the xsde-users mailing list