Problems with JSON descriptor and coder function generation
Submitted by Botond Baranyi
Assigned to Botond Baranyi
Link to original bug (#516404)
Description
1.) When generating code for a record of/set of type with JSON encoding support and with the -X compiler option (which disables the XER codec), the element type's type descriptor (and JSON descriptor) is not generated, but a reference to it is still generated in the record of/set of type's type descriptor.
Example: type record Rec { integer num, charstring str } with { encode "JSON" }
type record of Rec Recs with { encode "JSON" } // C++ error: 'Recs_0_descr_' was not declared in this scope
This only occurs if the -X compiler option is present and if the element type is a structure.
2.) If a structured type with no JSON encoding support is embedded in another structure, which has JSON encoding support, then the first structure's JSON coder functions are not generated (even though they are used in the second structure's JSON coder functions).
Example: type record Rec { integer num, charstring str }
type record of Rec Recs with { encode "JSON" } // C++ error: 'class X::Rec' has no member named 'JSON_encode'
type set Set { Rec rec } with { encode "JSON" } // C++ error: 'class X::Rec' has no member named 'JSON_encode'
This only occurs in Runtime 1.
Version: 6.1.0