diff options
author | Dirk Sandbrink <dsandbrink@gmail.com> | 2022-01-17 10:56:35 +0100 |
---|---|---|
committer | Dirk Sandbrink <dsandbrink@gmail.com> | 2022-01-17 23:25:42 +0100 |
commit | d3f13f0907dda34dff1ecc7dd7bc4fec2b26f168 (patch) | |
tree | 924fe783668842962ec099548075bc4cdc919758 | |
parent | 16b490ce1fd1e102ef27363c78cccedb16d4fbe2 (diff) | |
download | thrift-d3f13f0907dda34dff1ecc7dd7bc4fec2b26f168.tar.gz |
THRIFT-5418: Fix missing implementation for enum functions
If a thrift file only contains an enum, then the c++ source file with
the implementation for to_string and ostream operator<< is not
generated.
This bug was introduced in PR#2095 / THRIFT-5168.
-rw-r--r-- | compiler/cpp/src/thrift/generate/t_cpp_generator.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc index 4ef6acfbb..7e9d9b0a7 100644 --- a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc @@ -620,6 +620,8 @@ void t_cpp_generator::generate_enum(t_enum* tenum) { generate_enum_to_string_helper_function_decl(f_types_, tenum); generate_enum_to_string_helper_function(f_types_impl_, tenum); + + has_members_ = true; } void t_cpp_generator::generate_enum_ostream_operator_decl(std::ostream& out, t_enum* tenum) { |