Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Use C++17 inline variables for enum_value #8489

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tzik
Copy link
Contributor

@tzik tzik commented Jan 17, 2025

Trait structs have declarations of enum_value, which are static variables, but these structs don't have the instance definition of the variables. That causes link errors if a user takes the address of such variables, explicitly or implicitly. (ref: https://wandbox.org/permlink/oIB71xEbLzU5QIH6 )

We can easily solve it by converting them to inline variables in C++17.
(ref: https://wandbox.org/permlink/GqrQKdIDETQiS1v4 )
WDYT?

@github-actions github-actions bot added c++ codegen Involving generating code from schema labels Jan 17, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant