take-cheeze / mruby-marshal

mruby implementation of cruby marshaling.
12 stars 9 forks source link

Bug fix: Clang 13 fails with a syntax error. #40

Closed suetanvil closed 1 year ago

suetanvil commented 1 year ago

Clang 13 was failing with a syntax error on the definition of variable 'meta':

auto meta = hash_marshal_meta{*this, limit};

This change adds a trivial constructor to the struct definition and calls it instead.

(I suspect the original code isn't standard C++ and only works because it falls back to C behaviour that the compiler used to provide as an extension. However, I didn't confirm that since either way, the better solution is just to do something less ambiguous.)

This is a fix for https://github.com/take-cheeze/mruby-marshal/issues/41