You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by em...@apache.org on 2022/01/18 08:12:28 UTC

[thrift] branch master updated: THRIFT-5418: Fix missing implementation for enum functions

This is an automated email from the ASF dual-hosted git repository.

emmenlau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new d3f13f0  THRIFT-5418: Fix missing implementation for enum functions
     new 11dc245  Merge pull request #2504 from dsandbrink/bugfix/thrift_5418
d3f13f0 is described below

commit d3f13f0907dda34dff1ecc7dd7bc4fec2b26f168
Author: Dirk Sandbrink <ds...@gmail.com>
AuthorDate: Mon Jan 17 10:56:35 2022 +0100

    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.
---
 compiler/cpp/src/thrift/generate/t_cpp_generator.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
index 4ef6acf..7e9d9b0 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) {