Skip to content

Avoid C++ verifier template name collisions - #9217

Open
xThreeh wants to merge 1 commit into
google:masterfrom
xThreeh:fix-cpp-verifier-template-collision
Open

Avoid C++ verifier template name collisions#9217
xThreeh wants to merge 1 commit into
google:masterfrom
xThreeh:fix-cpp-verifier-template-collision

Conversation

@xThreeh

@xThreeh xThreeh commented Sep 2, 2026

Copy link
Copy Markdown

Fixes #9066.

A C++ table field named B currently collides with the generated verifier template parameter B, producing invalid code such as verifier.VerifyTable(B()).

This renames the generated template parameter to VerifySizePrefixed and adds a focused regression that generates and compiles a schema containing a B field.

Validation:

  • cmake --build build-collision --target flatc
  • python3 tests/test_cpp_field_name_collision.py build-collision/flatc
  • Generated header compiles with c++ -std=c++11 -fsyntax-only.

@github-actions github-actions Bot added python c++ codegen Involving generating code from schema labels Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Current release: generated code variables collision (possible regression)

1 participant