)]}'
{
  "commit": "ab178fbf24e88bba05ae2b8f1f9876d783e934f6",
  "tree": "cbf971b39aece232fc9bde5468873bdc109e87af",
  "parents": [
    "55e86e396e63969e3ee735b202b1c1de59c22c88"
  ],
  "author": {
    "name": "Copilot",
    "email": "198982749+Copilot@users.noreply.github.com",
    "time": "Tue Jan 27 09:46:59 2026 -0800"
  },
  "committer": {
    "name": "Jens Geyer",
    "email": "Jens-G@users.noreply.github.com",
    "time": "Wed Jan 28 01:29:06 2026 +0100"
  },
  "message": "Support C++ 11 enum class generation via pure_enums\u003denum_class\n\nAdds C++ 11 `enum class` generation to the C++ code generator. When `pure_enums\u003denum_class` is specified, generates strongly-typed enums with proper scoping and type safety.\n\n## Code Generator Changes\n\n**Modified `t_cpp_generator.cc`:**\n- Added `gen_enum_class_` flag parsed from `pure_enums\u003denum_class` option\n- Modified `generate_enum()` to emit `enum class` when both `gen_pure_enums_` and `gen_enum_class_` are set\n- Fixed enum value scoping: use `static_cast\u003cint\u003e(Color::RED)` for array initialization\n- Fixed map operations: cast enum class to int in `find()` calls (no implicit conversion)\n\n**Test infrastructure:**\n- Created `t_cpp_generator_enum_class_tests.cc` with three test cases validating default, `pure_enums`, and `pure_enums\u003denum_class` behavior\n- Extracted common utilities to `t_cpp_generator_test_utils.h` (shared with `private_optional` tests)\n- Added expected output files: `expected_Color_{default,pure_enums,enum_class}.txt`\n\n**Build system:**\n- Added CMake compile-checks for generated code (both `private_optional` and `enum_class`)\n- Unified compile-check blocks with shared Boost detection\n- Ensures generated code compiles as part of standard test build\n\n## Usage\n\n```thrift\nenum Color {\n  RED \u003d 1,\n  GREEN \u003d 2,\n  BLUE \u003d 3\n}\n```\n\n```bash\nthrift --gen cpp:pure_enums\u003denum_class example.thrift\n```\n\nGenerates:\n```cpp\nenum class Color {\n  RED \u003d 1,\n  GREEN \u003d 2,\n  BLUE \u003d 3\n};\n```\n\nBackward compatible - existing behavior unchanged when option absent.\n\n---\n\n- [ ] Did you create an [Apache Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket?  ([Request account here](https://selfserve.apache.org/jira-account.html), not required for trivial changes)\n- [ ] If a ticket exists: Does your pull request title follow the pattern \"THRIFT-NNNN: describe my issue\"?\n- [x] Did you squash your changes to a single commit?  (not required, but preferred)\n- [x] Did you do your best to avoid breaking changes?  If one was needed, did you label the Jira ticket with \"Breaking-Change\"?\n- [ ] If your change does not involve any code, include `[skip ci]` anywhere in the commit message to free up build resources.\n\n---------\n\nCo-authored-by: copilot-swe-agent[bot] \u003c198982749+Copilot@users.noreply.github.com\u003e\nCo-authored-by: zsy056 \u003c1074382+zsy056@users.noreply.github.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0fd47642dab736981812148758e8b1856734c659",
      "old_mode": 33188,
      "old_path": ".gitignore",
      "new_id": "aeaaf2ff39f9ff6fe1d0b0cc79a50c5e213898d2",
      "new_mode": 33188,
      "new_path": ".gitignore"
    },
    {
      "type": "modify",
      "old_id": "f6a15b317da97d028df82b2cbddf0ad1634a85f7",
      "old_mode": 33188,
      "old_path": "compiler/cpp/src/thrift/generate/t_cpp_generator.cc",
      "new_id": "4c427b1d4d89cc92cf3d8281195a0497f0fc37e4",
      "new_mode": 33188,
      "new_path": "compiler/cpp/src/thrift/generate/t_cpp_generator.cc"
    },
    {
      "type": "modify",
      "old_id": "77c15244a55c99a5fd582d52f27b2bf5609d5df7",
      "old_mode": 33188,
      "old_path": "compiler/cpp/tests/CMakeLists.txt",
      "new_id": "468de6ee846355004d5f32845908e22ad439e546",
      "new_mode": 33188,
      "new_path": "compiler/cpp/tests/CMakeLists.txt"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "94f3226e69c2a30477cf6afe8ab531e23bf242bb",
      "new_mode": 33188,
      "new_path": "compiler/cpp/tests/cpp/expected_Color_default.txt"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f21bc8e5503620b91a976626e0683070b60d467c",
      "new_mode": 33188,
      "new_path": "compiler/cpp/tests/cpp/expected_Color_enum_class.txt"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2294c62d1926afe2587783e0528943d972e28ee4",
      "new_mode": 33188,
      "new_path": "compiler/cpp/tests/cpp/expected_Color_pure_enums.txt"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "56404ad214b96dd59ab7a713152f3f37047dc881",
      "new_mode": 33188,
      "new_path": "compiler/cpp/tests/cpp/t_cpp_generator_enum_class_tests.cc"
    },
    {
      "type": "modify",
      "old_id": "9f48229d778788ff9aedf1942441e301564676cd",
      "old_mode": 33188,
      "old_path": "compiler/cpp/tests/cpp/t_cpp_generator_private_optional_tests.cc",
      "new_id": "2d63cb4ffb75c278e1351dbf30c7b11f59464b16",
      "new_mode": 33188,
      "new_path": "compiler/cpp/tests/cpp/t_cpp_generator_private_optional_tests.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5cea69a417f3f242bd56305de37df2ed19eec7a3",
      "new_mode": 33188,
      "new_path": "compiler/cpp/tests/cpp/t_cpp_generator_test_utils.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "bf85e32d55c79434b88525ab6dc6686bb69ec809",
      "new_mode": 33188,
      "new_path": "compiler/cpp/tests/cpp/test_enum_class.thrift"
    }
  ]
}
