summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2016-12-15 20:28:09 -0500
committerBernard Normier <bernard@zeroc.com>2016-12-15 20:28:09 -0500
commit308f4f33a9184bb37787992aa66975d105d56fda (patch)
tree79531403253aa4615ab5247fd79d1a4a03a03480 /cpp/src/slice2cpp
parentNew C++ Slice/clash test (diff)
downloadice-308f4f33a9184bb37787992aa66975d105d56fda.tar.bz2
ice-308f4f33a9184bb37787992aa66975d105d56fda.tar.xz
ice-308f4f33a9184bb37787992aa66975d105d56fda.zip
Fixed deprecated warning and other warnings with clang
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 185f987f2b2..cf7cf502f22 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -704,6 +704,7 @@ Slice::Gen::generate(const UnitPtr& p)
C << nl << "# pragma warning(disable:4458) // declaration of ... hides class member";
C << nl << "#elif defined(__clang__)";
C << nl << "# pragma clang diagnostic ignored \"-Wshadow\"";
+ C << nl << "# pragma clang diagnostic ignored \"-Wdeprecated-declarations\"";
C << nl << "#elif defined(__GNUC__)";
C << nl << "# pragma GCC diagnostic ignored \"-Wshadow\"";
C << nl << "#endif";
@@ -5329,6 +5330,10 @@ Slice::Gen::Cpp11TypesVisitor::visitExceptionStart(const ExceptionPtr& p)
// Out of line dtor to avoid weak vtable
H << sp << nl << _dllMemberExport << "virtual ~" << name << "();";
+
+ // Default copy ctor
+ H << sp << nl << name << "(const " << name << "&) = default;";
+
C << sp;
C << nl << scoped.substr(2) << "::~" << name << "()";
C << sb;
@@ -6353,7 +6358,7 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
//
// Out of line virtual dtor to avoid weak vtable
//
- H << sp << nl << _dllMemberExport << "virtual ~" << name << "();";
+ H << nl << _dllMemberExport << "virtual ~" << name << "();";
C << sp << nl << scoped.substr(2) << "::~" << name << "()";
C << sb;
C << eb;
@@ -6390,6 +6395,11 @@ Slice::Gen::Cpp11LocalObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
H << sp << nl << name << "() = default;";
}
+ H << sp << nl << name << "(const " << name << "&) = default;";
+ H << nl << name << "(" << name << "&&) = default;";
+ H << nl << name << "& operator=(const " << name << "&) = default;";
+ H << nl << name << "& operator=(" << name << "&&) = default;";
+
emitOneShotConstructor(p);
}
@@ -7148,6 +7158,11 @@ Slice::Gen::Cpp11ValueVisitor::visitClassDefStart(const ClassDefPtr& p)
H << sp << nl << name << "() = default;";
+ H << sp << nl << name << "(const " << name << "&) = default;";
+ H << nl << name << "(" << name << "&&) = default;";
+ H << nl << name << "& operator=(const " << name << "&) = default;";
+ H << nl << name << "& operator=(" << name << "&&) = default;";
+
emitOneShotConstructor(p);
writeIceTuple(H, p->allDataMembers(), _useWstring);