You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the &convert attribute we support any RHS expressions which produce a value, i.e., the RHS can e.g., be a function, a value, or a literal. This got broken for bitfield fields with #1492 (in particular f3a8bdf).
$ spicyc -dj foo.spicy/private/var/folders/ht/vtb0rkbd4ws15vx02xdb84zw0000gn/T/foo_1c0ff69c973b5abc-2ab7850513fcbfef.cc:74:136: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal] const ::hilti::rt::TypeInfo __ti_bitfieldx2a8x2b_x73__d_0_7_x28convertx31_foo_x3e_x75 = { {}, "bitfield(8) { d: 0..7 &convert="foo"; }", new ::hilti::rt::type_info::Bitfield(std::vector<::hilti::rt::type_info::bitfield::Bits>({::hilti::rt::type_info::bitfield::Bits{ "d", &::hilti::rt::type_info::string, hilti::rt::bitfield::elementOffset<hilti::rt::Bitfield<std::string, ::hilti::rt::integer::safe<uint8_t>>, 0>() }})) }; ^/private/var/folders/ht/vtb0rkbd4ws15vx02xdb84zw0000gn/T/foo_1c0ff69c973b5abc-2ab7850513fcbfef.cc:74:136: error: expected '}'/private/var/folders/ht/vtb0rkbd4ws15vx02xdb84zw0000gn/T/foo_1c0ff69c973b5abc-2ab7850513fcbfef.cc:74:93: note: to match this '{' const ::hilti::rt::TypeInfo __ti_bitfieldx2a8x2b_x73__d_0_7_x28convertx31_foo_x3e_x75 = { {}, "bitfield(8) { d: 0..7 &convert="foo"; }", new ::hilti::rt::type_info::Bitfield(std::vector<::hilti::rt::type_info::bitfield::Bits>({::hilti::rt::type_info::bitfield::Bits{ "d", &::hilti::rt::type_info::string, hilti::rt::bitfield::elementOffset<hilti::rt::Bitfield<std::string, ::hilti::rt::integer::safe<uint8_t>>, 0>() }})) }; ^In file included from /private/var/folders/ht/vtb0rkbd4ws15vx02xdb84zw0000gn/T/foo_1c0ff69c973b5abc-2ab7850513fcbfef.cc:1:In file included from /Users/bbannier/src/spicy/hilti/runtime/include/hilti/rt/libhilti.h:9:In file included from /Users/bbannier/src/spicy/build/include/hilti/rt/autogen/config.h:5:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/string:576:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/string_view:1027:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/functional:515:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__functional/boyer_moore_searcher.h:25:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/unordered_map:530:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__node_handle:65:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/optional:646:5: error: static assertion failed due to requirement '!is_reference_v<const std::string &>': instantiation of optional with a reference type is ill-formed static_assert(!is_reference_v<value_type>, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__type_traits/is_empty.h:23:38: note: in instantiation of template class 'std::optional<const std::string &>' requested here : public integral_constant<bool, __is_empty(_Tp)> {}; ^/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/tuple:273:16: note: in instantiation of template class 'std::is_empty<std::optional<const std::string &>>' requested here bool=is_empty<_Hp>::value && !__libcpp_is_final<_Hp>::value ^/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/tuple:480:14: note: in instantiation of default argument for '__tuple_leaf<0UL, std::optional<const std::string &>>' required here : public __tuple_leaf<_Indx, _Tp>... ^~~~~~~~~~~~~~~~~~~~~~~~/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/tuple:570:12: note: in instantiation of template class 'std::__tuple_impl<std::__tuple_indices<0, 1>, std::optional<const std::string &>, std::optional<SafeInt<unsigned char, hilti::rt::integer::detail::SafeIntException>>>' requested here _BaseT __base_; ^/Users/bbannier/src/spicy/hilti/runtime/include/hilti/rt/types/bitfield.h:26:38: note: in instantiation of template class 'std::tuple<std::optional<const std::string &>, std::optional<SafeInt<unsigned char, hilti::rt::integer::detail::SafeIntException>>>' requested here std::tuple<std::optional<Ts>...> value; ^/private/var/folders/ht/vtb0rkbd4ws15vx02xdb84zw0000gn/T/foo_1c0ff69c973b5abc-2ab7850513fcbfef.cc:163:229: note: in instantiation of template class 'hilti::rt::Bitfield<const std::string &, SafeInt<unsigned char, hilti::rt::integer::detail::SafeIntException>>' requested here std::tie(::hilti::rt::optional::valueOrInit((*__self)._anon_3), __cur) = (__x_2 = ::hilti::rt::integer::unpack<uint8_t>(__cur, ::hilti::rt::ByteOrder{::hilti::rt::ByteOrder::Network}), hilti::rt::make_result(std::make_tuple(hilti::rt::make_bitfield(__hlt::foo::FOO2, hilti::rt::integer::noop(std::get<0>(*__x_2))), std::get<1>(*__x_2)))).valueOrThrow(); ^In file included from /private/var/folders/ht/vtb0rkbd4ws15vx02xdb84zw0000gn/T/foo_1c0ff69c973b5abc-2ab7850513fcbfef.cc:1:In file included from /Users/bbannier/src/spicy/hilti/runtime/include/hilti/rt/libhilti.h:9:In file included from /Users/bbannier/src/spicy/build/include/hilti/rt/autogen/config.h:5:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/string:576:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/string_view:1027:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/functional:515:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__functional/boyer_moore_searcher.h:25:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/unordered_map:530:In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__node_handle:65:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/optional:646:5: error: static assertion failed due to requirement '!is_reference_v<std::string &>': instantiation of optional with a reference type is ill-formed static_assert(!is_reference_v<value_type>, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__type_traits/is_empty.h:23:38: note: in instantiation of template class 'std::optional<std::string &>' requested here : public integral_constant<bool, __is_empty(_Tp)> {}; ^/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/tuple:273:16: note: in instantiation of template class 'std::is_empty<std::optional<std::string &>>' requested here bool=is_empty<_Hp>::value && !__libcpp_is_final<_Hp>::value ^/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/tuple:480:14: note: in instantiation of default argument for '__tuple_leaf<0UL, std::optional<std::string &>>' required here : public __tuple_leaf<_Indx, _Tp>... ^~~~~~~~~~~~~~~~~~~~~~~~/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/tuple:570:12: note: in instantiation of template class 'std::__tuple_impl<std::__tuple_indices<0, 1>, std::optional<std::string &>, std::optional<SafeInt<unsigned char, hilti::rt::integer::detail::SafeIntException>>>' requested here _BaseT __base_; ^/Users/bbannier/src/spicy/hilti/runtime/include/hilti/rt/types/bitfield.h:26:38: note: in instantiation of template class 'std::tuple<std::optional<std::string &>, std::optional<SafeInt<unsigned char, hilti::rt::integer::detail::SafeIntException>>>' requested here std::tuple<std::optional<Ts>...> value; ^/private/var/folders/ht/vtb0rkbd4ws15vx02xdb84zw0000gn/T/foo_1c0ff69c973b5abc-2ab7850513fcbfef.cc:186:229: note: in instantiation of template class 'hilti::rt::Bitfield<std::string &, SafeInt<unsigned char, hilti::rt::integer::detail::SafeIntException>>' requested here std::tie(::hilti::rt::optional::valueOrInit((*__self)._anon_4), __cur) = (__x_3 = ::hilti::rt::integer::unpack<uint8_t>(__cur, ::hilti::rt::ByteOrder{::hilti::rt::ByteOrder::Network}), hilti::rt::make_result(std::make_tuple(hilti::rt::make_bitfield((*__hlt::foo::FOO3), hilti::rt::integer::noop(std::get<0>(*__x_3))), std::get<1>(*__x_3)))).valueOrThrow(); ^4 errors generated.[error] spicyc: JIT compilation failed
The text was updated successfully, but these errors were encountered:
In the
&convert
attribute we support any RHS expressions which produce a value, i.e., the RHS can e.g., be a function, a value, or a literal. This got broken for bitfield fields with #1492 (in particular f3a8bdf).The text was updated successfully, but these errors were encountered: