zeek / spicy

C++ parser generator for dissecting protocols & files.
https://docs.zeek.org/projects/spicy
Other
243 stars 37 forks source link

Only allow creation of `const` variables from literals. #1765

Closed bbannier closed 2 months ago

bbannier commented 2 months ago

Since it is hard to enforce that const variables are initialized in correct order (order of decls usually is not significant in Spicy/HILTI and works e.g., for globals, but this is not the case for consts due to codegen), this patch disallows creating const values from anything but literals. This completely removes the ordering issue.

Closes #1763.