Skip to content

Commit

Permalink
Merge pull request OpenDDS#4800 from banburybill/bad_tag_gen
Browse files Browse the repository at this point in the history
Fix incorrect separator when generating tag type
  • Loading branch information
jrw972 authored Sep 23, 2024
2 parents 16842a5 + ee7d4e4 commit d79179d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dds/idl/metaclass_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ void generate_anon_fields(AST_Structure* node)
post = "_forany";
} else if (use_cxx11 && (elem_cls & (CL_ARRAY | CL_SEQUENCE))) {
pre = "IDL::DistinctType<";
post = ", " + dds_generator::get_tag_name(dds_generator::scoped_helper(deepest_named_type(elem_orig)->name(), "_")) + ">";
post = ", " + dds_generator::get_tag_name(dds_generator::scoped_helper(deepest_named_type(elem_orig)->name(), "::")) + ">";
}
be_global->impl_ <<
" if (!gen_skip_over(ser, static_cast<" << pre << cxx_elem << post
Expand Down
12 changes: 12 additions & 0 deletions tests/DCPS/Compiler/idl_test1_lib/FooDef.idl
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,15 @@ union B88 switch (long) {
case 2: B43 b_85_2;
case 3: B41 b_85_3;
};

// Regression check that module and struct names containing '_' compile
// correctly. https://github.com/OpenDDS/OpenDDS/pull/4800.
module Test_Module {
typedef sequence<char, 100> A_Char100S;
};

typedef sequence<Test_Module::A_Char100S> Sequence_Type;

struct TestModuleStruct {
@id(1) Sequence_Type sequence_field;
};

0 comments on commit d79179d

Please sign in to comment.