Fixed 2 compiler warnings emitted from ./bootstrap.sh --cxx=g++

One complaining that the order in which == operators were declared was undefined, so making all four equals operations in the value_ref class depend on a single one was fragile and another that enums need to be explicitly static_casted since direct adding between two different enum types is deprecated, now the only warning is about calling free on a heap object in a yyparse function, which from a cursory glance is the compiler not realizing that it only gets freed if it isn't a heap object (#600)
This commit is contained in:
MatthewHartley
2026-06-25 18:15:33 -07:00
committed by GitHub
parent 50f853546c
commit 0ef020e619
2 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -560,7 +560,7 @@ struct jam_arg_spec_count_sum<X, A...>
// = X::count + jam_arg_spec_count_sum<A...>::value;
enum : std::size_t
{
value = X::count + jam_arg_spec_count_sum<A...>::value
value = static_cast<std::size_t>(X::count) + static_cast<std::size_t>(jam_arg_spec_count_sum<A...>::value)
};
};
+7 -4
View File
@@ -131,12 +131,15 @@ struct value_ref
inline bool operator==(value_ptr b) const { return val->equal_to(*b); }
inline bool operator==(const char * v) const
{
return (*this) == value_ref(v);
return val->equal_to(*value_ref(v));
}
template <typename T>
inline bool operator!=(T v) const
inline bool operator!=(value_ptr b) const
{
return !((*this) == v);
return !(val->equal_to(*b));
}
inline bool operator!=(const char * v) const
{
return !(val->equal_to(*value_ref(v)));
}
inline value_ptr operator->() const { return val; }
inline value & operator*() const { return *val; }