[Bug libstdc++/125439] std::in_range doesn't accept const-qualified result type
planet36 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon May 25 12:31:22 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125439
--- Comment #2 from Steve Ward <planet36 at gmail dot com> ---
(In reply to Jonathan Wakely from comment #1)
> Read the definition of signed and unsigned integers types, it's a list of
> types that does not include cv-qualified versions of those types.
>
> Contrast that with https://eel.is/c++draft/basic.fundamental#11 which says
> "the signed and unsigned integer types, and cv-qualified versions
> ([basic.type.qualifier]) thereof". If signed and unsigned integers types
> already included const versions, it wouldn't need to say "and cv-qualified
> versions thereof".
Sorry, I don't follow your reasoning. The linked definition seems to support
the example: `const int` is an integer type.
My example program was a little contrived. Here's a succinct example showing
that gcc (trunk) does not compile, but clang (trunk) with libc++ succeeds.
https://godbolt.org/z/YdEoPjd8o
More information about the Gcc-bugs
mailing list