Skip to content

Fix incomplete-type ownership for C++23 - #175

Draft
dzbarsky wants to merge 1 commit into
google:masterfrom
dzbarsky:codex/cxx23-compatibility
Draft

Fix incomplete-type ownership for C++23#175
dzbarsky wants to merge 1 commit into
google:masterfrom
dzbarsky:codex/cxx23-compatibility

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Aug 23, 2026

Copy link
Copy Markdown

Port the GoogleSQL source changes from cloud-spanner-emulator#375. C++23 toolchains can instantiate std::unique_ptr destruction and assignment while the owned AST, query, or operator type is incomplete. Move generated AST constructors and node-owning mutators out of line, emit factories after all node definitions, and place the affected visitor, SQL-builder, and operator definitions after the types they require. Keep GoogleSQL's C++20 default unchanged.

Validation: regenerated all 12 C++ AST outputs before and after the change, confirmed unchanged builder/visitor outputs, and checked matching declarations and unchanged bodies for every moved generated constructor and mutator. C++ compilation and runtime tests were not run.

Tracking issue: #178.

GoogleSQL's contribution guide asks for issues rather than external code contributions. This draft provides the proposed implementation for maintainers to incorporate internally.

-zbarskybot

Move generated AST constructors and node-owning mutators out of line,
and emit factories after all generated node definitions. Define the
affected visitor and SQLBuilder operations after their dependent types,
and order reference-implementation node definitions before owning
arguments. Keep GoogleSQL's C++20 default unchanged.

Port the seven-file GoogleSQL patch from
GoogleCloudPlatform/cloud-spanner-emulator#375.

Validation: regenerated all 12 C++ AST outputs before and after the
change; builder and visitor outputs are unchanged. Verified matching
declarations and unchanged bodies for every moved generated constructor
and mutator. C++ compilation and runtime tests were not run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant