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
When upgrading {fmt}, b4d1d7f8e broke some of our usage. We had a place where we were building up a format string using a type like this:
template <size_t N>
structfixed_string {
char data[N] = {};
constexprfixed_string(charconst (&m)[N]) {
for (size_t i = 0; i != N; ++i) {
data[i] = m[i];
}
}
};
And trying to do something like:
staticconstexprauto f = fixed_string("x={}");
fmt::print(f.data, 42);
This works on fmt 10.2.1 and 11.0, fails on trunk — after that commit, with:
/opt/compiler-explorer/libs/fmt/trunk/include/fmt/base.h:543:31: error: '__builtin_strlen(((const char*)(& f.fixed_string<5>::data)))' is not a constant expression
543 | size_ = __builtin_strlen(detail::narrow(s));
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
gcc says that __builtin_strlen isn't usable like this. Which... if they say so. But seems unlikely this will change, so I think {fmt} should also revert to previous usage.
The text was updated successfully, but these errors were encountered:
When upgrading
{fmt}
, b4d1d7f8e broke some of our usage. We had a place where we were building up a format string using a type like this:And trying to do something like:
This works on fmt 10.2.1 and 11.0, fails on trunk — after that commit, with:
gcc says that
__builtin_strlen
isn't usable like this. Which... if they say so. But seems unlikely this will change, so I think{fmt}
should also revert to previous usage.The text was updated successfully, but these errors were encountered: