https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96042

--- Comment #2 from gcc-bugs at marehr dot dialup.fu-berlin.de ---
I think this is too easy to say that this is not a "bug", we can also weaken
the terminology and say "potential-inconsistency".

Technically you are right, but only because there seems to be a specific
"exception" for the implementation does not mean that this is the right thing
to do.

<unhappy-end-user - ignore this>
I personally don't understand why the standard allows exceptions outside it's
echo-system, I guess the stdlib implementers understand the subject better when
forming the standard, and are lobbing harder for their necessities which is
sometimes different from the needs / expectation of the end-user.
</unhappy-end-user- ignore this>

Can you help me figure out in which cases `-std=c++2a` would produce this type?
Or asked differently: In which cases, other than this, do I encounter a
`__int128` from using only types and functions defined in the standard?

I have the feeling from your answer that this type is an everyday type.

Looking at https://eel.is/c++draft/range.iota#view-1, and if I read it
correctly, this is case 3:

> Otherwise, IOTA-DIFF-T(W) is an unspecified signed-integer-like type
> ([iterator.concept.winc]) of width not less than the width of W.
> 
> [Note: It is unspecified whether this type satisfies
> weakly_­incrementable. — end note]

It means it would be totally fine to return the signed version of `size_t`,
because it has at least the same width. (This would be a valid option, too)

Thank you for your time!

Reply via email to