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
The specific std::uniform_int_distribution<__int128_t>{INT64_MIN, INT64_MAX} produces values that are not in range. Changing any of the parameters -- e.g. using std::int64_t as type or making either of the limits smaller or larger -- causes the problem to go away. The incorrect values are completely out-of-range, not marginal off-by-one errors.
I have created the following test program and could reproduce the issue with every version of libc++ and set of compiler options I've tried; the problem never occurs with -stdlib=libstdc++ so it seems to me to be a library rather than a compiler issue.
Extended Description
The specific
std::uniform_int_distribution<__int128_t>{INT64_MIN, INT64_MAX}
produces values that are not in range. Changing any of the parameters -- e.g. usingstd::int64_t
as type or making either of the limits smaller or larger -- causes the problem to go away. The incorrect values are completely out-of-range, not marginal off-by-one errors.I have created the following test program and could reproduce the issue with every version of libc++ and set of compiler options I've tried; the problem never occurs with
-stdlib=libstdc++
so it seems to me to be a library rather than a compiler issue.https://godbolt.org/z/z5WYsKEv6
This is a minimal version (with no output) of the demo linked above to reproduce the problem:
The text was updated successfully, but these errors were encountered: