aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-12-25 11:59:14 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-01-13 22:32:44 +0300
commitac58ebce44e0ea4c4dabca3f4440eb21bfe3dd2a (patch)
treec7648e37dff5aba76eff33f3009d052be9f518c1
parent818bcfa0dbbc1ef48bc3fe1f0c14d12866c51ef2 (diff)
Fix GCC 'implicitly-declared copy constructor is deprecated' warningc++98-tests
Note that since c++11 the generation of the implicit copy constructor is deprecated for a class with a user-defined copy assignment operator.
-rw-r--r--libxsd/libxsd/cxx/tree/containers.hxx10
-rw-r--r--libxsd/libxsd/cxx/tree/date-time.hxx45
-rw-r--r--libxsd/libxsd/cxx/tree/elements.hxx10
-rw-r--r--libxsd/libxsd/cxx/tree/list.hxx10
-rw-r--r--libxsd/libxsd/cxx/tree/types.hxx20
-rw-r--r--xsd/xsd/cxx/tree/tree-header.cxx38
6 files changed, 133 insertions, 0 deletions
diff --git a/libxsd/libxsd/cxx/tree/containers.hxx b/libxsd/libxsd/cxx/tree/containers.hxx
index 07dff0d..43b70e4 100644
--- a/libxsd/libxsd/cxx/tree/containers.hxx
+++ b/libxsd/libxsd/cxx/tree/containers.hxx
@@ -858,6 +858,11 @@ namespace xsd
{
}
+#ifdef XSD_CXX11
+ sequence&
+ operator= (const sequence&) = default;
+#endif
+
public:
void
assign (size_type n, const T& x)
@@ -1132,6 +1137,11 @@ namespace xsd
: base_sequence (s)
{
}
+
+#ifdef XSD_CXX11
+ sequence&
+ operator= (const sequence&) = default;
+#endif
};
diff --git a/libxsd/libxsd/cxx/tree/date-time.hxx b/libxsd/libxsd/cxx/tree/date-time.hxx
index 7c14ffd..d4e3c58 100644
--- a/libxsd/libxsd/cxx/tree/date-time.hxx
+++ b/libxsd/libxsd/cxx/tree/date-time.hxx
@@ -210,6 +210,11 @@ namespace xsd
*/
gday (const gday& x, flags f = 0, container* c = 0);
+#ifdef XSD_CXX11
+ gday&
+ operator= (const gday&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -371,6 +376,11 @@ namespace xsd
*/
gmonth (const gmonth& x, flags f = 0, container* c = 0);
+#ifdef XSD_CXX11
+ gmonth&
+ operator= (const gmonth&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -532,6 +542,11 @@ namespace xsd
*/
gyear (const gyear& x, flags f = 0, container* c = 0);
+#ifdef XSD_CXX11
+ gyear&
+ operator= (const gyear&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -696,6 +711,11 @@ namespace xsd
*/
gmonth_day (const gmonth_day& x, flags f = 0, container* c = 0);
+#ifdef XSD_CXX11
+ gmonth_day&
+ operator= (const gmonth_day&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -880,6 +900,11 @@ namespace xsd
*/
gyear_month (const gyear_month& x, flags f = 0, container* c = 0);
+#ifdef XSD_CXX11
+ gyear_month&
+ operator= (const gyear_month&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -1068,6 +1093,11 @@ namespace xsd
*/
date (const date& x, flags f = 0, container* c = 0);
+#ifdef XSD_CXX11
+ date&
+ operator= (const date&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -1269,6 +1299,11 @@ namespace xsd
*/
time (const time& x, flags f = 0, container* c = 0);
+#ifdef XSD_CXX11
+ time&
+ operator= (const time&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -1493,6 +1528,11 @@ namespace xsd
virtual date_time*
_clone (flags f = 0, container* c = 0) const;
+#ifdef XSD_CXX11
+ date_time&
+ operator= (const date_time&) = default;
+#endif
+
/**
* @brief Create an instance from a data representation
* stream.
@@ -1723,6 +1763,11 @@ namespace xsd
*/
duration (const duration& x, flags f = 0, container* c = 0);
+#ifdef XSD_CXX11
+ duration&
+ operator= (const duration&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
diff --git a/libxsd/libxsd/cxx/tree/elements.hxx b/libxsd/libxsd/cxx/tree/elements.hxx
index 7eb8211..8cdd0c3 100644
--- a/libxsd/libxsd/cxx/tree/elements.hxx
+++ b/libxsd/libxsd/cxx/tree/elements.hxx
@@ -1254,6 +1254,11 @@ namespace xsd
*/
simple_type (const simple_type& x, flags f = 0, container* c = 0);
+#ifdef XSD_CXX11
+ simple_type&
+ operator= (const simple_type&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -1617,6 +1622,11 @@ namespace xsd
{
}
+#ifdef XSD_CXX11
+ fundamental_base&
+ operator= (const fundamental_base&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
diff --git a/libxsd/libxsd/cxx/tree/list.hxx b/libxsd/libxsd/cxx/tree/list.hxx
index 13a86e6..e54b75d 100644
--- a/libxsd/libxsd/cxx/tree/list.hxx
+++ b/libxsd/libxsd/cxx/tree/list.hxx
@@ -62,6 +62,11 @@ namespace xsd
{
}
+#ifdef XSD_CXX11
+ list&
+ operator= (const list&) = default;
+#endif
+
public:
list (const xercesc::DOMElement&, flags = 0, container* c = 0);
@@ -112,6 +117,11 @@ namespace xsd
{
}
+#ifdef XSD_CXX11
+ list&
+ operator= (const list&) = default;
+#endif
+
public:
list (const xercesc::DOMElement&, flags = 0, container* c = 0);
diff --git a/libxsd/libxsd/cxx/tree/types.hxx b/libxsd/libxsd/cxx/tree/types.hxx
index 4d6079a..1ec4243 100644
--- a/libxsd/libxsd/cxx/tree/types.hxx
+++ b/libxsd/libxsd/cxx/tree/types.hxx
@@ -1078,6 +1078,11 @@ namespace xsd
{
}
+#ifdef XSD_CXX11
+ nmtokens&
+ operator= (const nmtokens&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -2559,6 +2564,11 @@ namespace xsd
{
}
+#ifdef XSD_CXX11
+ idrefs&
+ operator= (const idrefs&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -2967,6 +2977,11 @@ namespace xsd
//
}
+#ifdef XSD_CXX11
+ qname&
+ operator= (const qname&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
@@ -3849,6 +3864,11 @@ namespace xsd
{
}
+#ifdef XSD_CXX11
+ entities&
+ operator= (const entities&) = default;
+#endif
+
/**
* @brief Copy the instance polymorphically.
*
diff --git a/xsd/xsd/cxx/tree/tree-header.cxx b/xsd/xsd/cxx/tree/tree-header.cxx
index ffec3a3..6987d5e 100644
--- a/xsd/xsd/cxx/tree/tree-header.cxx
+++ b/xsd/xsd/cxx/tree/tree-header.cxx
@@ -252,6 +252,12 @@ namespace CXX
<< container << "* c = 0);"
<< endl;
+ os << "#ifdef XSD_CXX11" << endl
+ << name << "&" << endl
+ << "operator= (const " << name << "&) = default;"
+ << "#endif" << endl
+ << endl;
+
// clone
//
if (doxygen)
@@ -527,6 +533,12 @@ namespace CXX
<< container << "* c = 0);"
<< endl;
+ os << "#ifdef XSD_CXX11" << endl
+ << name << "&" << endl
+ << "operator= (const " << name << "&) = default;"
+ << "#endif" << endl
+ << endl;
+
// clone
//
if (doxygen)
@@ -942,6 +954,12 @@ namespace CXX
<< container << "* c = 0);"
<< endl;
+ os << "#ifdef XSD_CXX11" << endl
+ << name << "&" << endl
+ << "operator= (const " << name << "&) = default;"
+ << "#endif" << endl
+ << endl;
+
// clone
//
if (doxygen)
@@ -3319,11 +3337,14 @@ namespace CXX
// operator=
//
bool priv (false);
+ bool asop (true);
if (!simple)
{
if (options.suppress_assignment ())
{
+ asop = false;
+
priv = true;
os << "private:" << endl;
@@ -3343,6 +3364,8 @@ namespace CXX
}
else if (has_members || (gen_wildcard && (hae || haa)))
{
+ asop = false;
+
if (doxygen)
{
os << "/**" << endl
@@ -3371,6 +3394,15 @@ namespace CXX
if (priv)
os << "public:" << endl;
+ if (asop)
+ {
+ os << "#ifdef XSD_CXX11" << endl
+ << name << "&" << endl
+ << "operator= (const " << name << "&) = default;"
+ << "#endif" << endl
+ << endl;
+ }
+
// d-tor
//
if (doxygen)
@@ -3872,6 +3904,12 @@ namespace CXX
flags_type << " f = 0);"
<< endl;
+ os << "#ifdef XSD_CXX11" << endl
+ << name << "&" << endl
+ << "operator= (const " << name << "&) = default;"
+ << "#endif" << endl
+ << endl;
+
// _clone
//
if (doxygen)