Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup constructor workarounds #415

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions ridlbe/c++11/templates/cli/hdr/interface_post.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ protected:
TAOX11_CORBA::abstractbase_reference<TAOX11_CORBA::AbstractBase>);
#endif /* clang <= 11 */

%# msvc14.{0|1|2} have a problem with defaulted constructors, issue #4005
#if defined (_MSC_VER) && (_MSC_VER < 1930)
<%= cxxname %> () {}
#else
<%= cxxname %> () = default;
#endif /* _MSC_VER < 1930 */
<%= cxxname %> (TAOX11_NAMESPACE::Abstractbase_proxy_ptr prx);
~<%= cxxname %> () override = default;
/// Required for derived value types
Expand Down Expand Up @@ -72,15 +67,8 @@ private:
protected:
using _shared_ptr_type = std::shared_ptr<<%= cxxname %>>;

%# msvc14.{0|1|2} have a bug that when using a defaulted constructor here we get a crash in the portableserver library
%# for the POA
#if defined (_MSC_VER) && (_MSC_VER < 1930)
/// Default constructor
<%= cxxname %> () {};
#else
/// Default constructor
<%= cxxname %> () = default;
#endif /* _MSC_VER < 1930 */
/// Destructor
~<%= cxxname %> () override = default;

Expand Down
10 changes: 0 additions & 10 deletions ridlbe/c++11/templates/cli/hdr/union_post.erb
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,12 @@ private:
<%= switch_cxxtype %> disc_ {<% if has_default?() || has_implicit_default?() %><%= default_label %><% else %><%= members.first.nondefault_labels.first %><% end %>};
union u_type_
{
#if defined (_MSC_VER) && (_MSC_VER < 1930)
u_type_ ();
#else
u_type_ () = default;
#endif
~u_type_ ();
% members.each do |_m|
% # The default member or the first member should use the value_initializer
% # Visual Studio 2019 doesn't seem to like using default, this leads to
% # an internal compiler error, see SW331
% if (has_default?() && _m.is_default?) || (!has_default?() && _m == members.first)
#if defined (_MSC_VER) && (_MSC_VER < 1930)
<%= _m.cxx_member_type %> <%= _m.cxxname %>_;
#else
<%= _m.cxx_member_type %> <%= _m.cxxname %>_<% if (has_default?() && _m.is_default?) || (!has_default?() && _m == members.first) %> <%= _m.value_initializer %><% end %>;
#endif
% else
<%= _m.cxx_member_type %> <%= _m.cxxname %>_;
% end
Expand Down
5 changes: 0 additions & 5 deletions ridlbe/c++11/templates/cli/hdr/valuetype_obv.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ namespace obv
% end
{
protected:
%# msvc14.{0|1} have a problem with defaulted constructors, issue #4005
#if defined (_MSC_VER) && (_MSC_VER < 1920)
<%= cxxname %> () {}
#else
<%= cxxname %> () = default;
#endif /* _MSC_VER < 1920 */
~<%= cxxname %> () override = default;
<%= cxxname %> (const <%= cxxname %>&) = default;
<%= cxxname %> (<%= cxxname %>&&) = default;
Expand Down
11 changes: 0 additions & 11 deletions ridlbe/c++11/templates/cli/inl/union_inl.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
// generated from <%= ridl_template_path %>
#if defined (_MSC_VER) && (_MSC_VER < 1930)
inline <%= scoped_cxxname %>::u_type_::u_type_ ()
% if has_default?()
: <%= default_member.cxxname %>_<%= default_member.value_initializer %>
% else
: <%= members.first.cxxname %>_<%= members.first.value_initializer %>
% end
{
}
#endif

inline <%= scoped_cxxname %>::u_type_::~u_type_ ()
{
}
Expand Down
Loading