From a2d38e2374606dfd83d2113dec90024a23e075b2 Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Thu, 9 Jan 2025 18:24:06 -0600 Subject: [PATCH] Use = default for skeleton copy constructor But only when `ACE_HAS_CPP11` is defined. This is a sort of backport of https://github.com/DOCGroup/ACE_TAO/pull/2309. --- TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp | 7 ++++++- TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp | 6 ++++-- TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp | 6 +++++- TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp | 8 +++++--- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp index b6de87989a591..ea6852f04192d 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp @@ -81,7 +81,12 @@ be_visitor_interface_ih::visit_interface (be_interface *node) << be_global->impl_class_prefix () << namebuf << be_global->impl_class_suffix () << " (const " << be_global->impl_class_prefix () << namebuf - << be_global->impl_class_suffix () << "&);" <impl_class_suffix () << "&)\n" + << "#ifdef ACE_HAS_CPP11" << be_idt_nl + << "= default\n" + << "#endif" << be_uidt_nl + << ";" << be_nl + << be_nl; } if (be_global->gen_assign_op ()) diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp index 689908bb22f25..5fd78c8ee9f2f 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp @@ -64,7 +64,8 @@ be_visitor_interface_is::visit_interface (be_interface *node) if (be_global->gen_copy_ctor () && !node->is_local ()) { - *os << "//Implementation Skeleton Copy Constructor" << be_nl; + *os << "//Implementation Skeleton Copy Constructor\n" + << "#ifndef ACE_HAS_CPP11" << be_nl; *os << be_global->impl_class_prefix () << node->flat_name () << be_global->impl_class_suffix () <<"::" @@ -105,7 +106,8 @@ be_visitor_interface_is::visit_interface (be_interface *node) *os << be_uidt_nl << "{" << be_nl - << "}" << be_nl << be_uidt_nl; + << "}\n" + << "#endif" << be_nl << be_uidt_nl; } if (be_global->gen_assign_op ()) diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp index f3bb867bb5e4c..5011e9100b817 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp @@ -115,7 +115,11 @@ be_visitor_interface_sh::visit_interface (be_interface *node) // Copy constructor and destructor. *os << class_name.c_str () << " (const " - << class_name.c_str () << "& rhs);" << be_nl + << class_name.c_str () << "& rhs)\n" + << "#ifdef ACE_HAS_CPP11" << be_idt_nl + << "= default\n" + << "#endif" << be_uidt_nl + << ";" << be_nl << "virtual ~" << class_name.c_str () << " (void);" << be_nl_2; // _is_a diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp index ea555e422910b..67b0de3b8a5cc 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -123,10 +123,11 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << "{" << be_idt_nl << "this->optable_ = &tao_" << flat_name << "_optable;" << be_uidt_nl - << "}" << be_nl_2; + << "}\n\n"; // find if we are at the top scope or inside some module - *os << full_skel_name << "::" + *os << "#ifndef ACE_HAS_CPP11" << be_nl + << full_skel_name << "::" << local_name_prefix << node_local_name << " (" << "const " << local_name_prefix << node_local_name << " &" @@ -150,7 +151,8 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << be_uidt_nl << "{" << be_nl - << "}" << be_nl_2; + << "}\n" + << "#endif" << be_nl_2; *os << full_skel_name << "::~" << local_name_prefix << node_local_name