Skip to content

Commit

Permalink
Fix generated code compilation when a union uses an alias with scope (#…
Browse files Browse the repository at this point in the history
…411)

* Refs #21823. Regression test

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>

* Refs #21823. Fix

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>

* Refs #21823. Apply suggestion

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>

* Refs #21823. Update submodule

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>

* Refs #21823. Fix render blank lines

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>

---------

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
  • Loading branch information
richiware authored Oct 25, 2024
1 parent fc9928b commit bbf86e3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,15 @@ $if(member.typecode.primitive)$
member_destructor_ = nullptr;
m_$member.name$ = $member_default_init(member)$;
$else$
member_destructor_ = [&]() {$union_member_destroy_call(member)$\};
member_destructor_ = [&]()
{
$if(member.typecode.isAliasType)$
$if(member.typecode.hasScope)$
using namespace $member.typecode.scope$;
$endif$
$endif$
$union_member_destroy_call(member)$
};
new(&m_$member.name$) $member_type_declaration(member)$();
$endif$
>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ main(ctx, definitions) ::= <<
$fileHeader(ctx=ctx, file=[ctx.filename, "main.cxx"], description=["This file acts as a main entry point to the application."])$

#include <csignal>
#include <cstring>
#include <functional>
#include <iostream>
#include <stdexcept>
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/dds-types-test
Submodule dds-types-test updated 1 files
+17 −0 IDL/unions.idl
2 changes: 1 addition & 1 deletion thirdparty/idl-parser

0 comments on commit bbf86e3

Please sign in to comment.