gcc/libstdc++-v3/include
Patrick Palka 1af937eb62 libstdc++: invalid default init in _CachedPosition [PR101231]
The primary template for _CachedPosition is a dummy implementation for
non-forward ranges, the iterators for which generally can't be cached.
Because this implementation doesn't actually cache anything, _M_has_value
is defined to be false and so calls to _M_get (which are always guarded
by _M_has_value) are unreachable.

Still, to suppress a "control reaches end of non-void function" warning
I made _M_get return {}, but after P2325 input iterators are no longer
necessarily default constructible so this workaround now breaks valid
programs.

This patch fixes this by instead using __builtin_unreachable to squelch
the warning.

	PR libstdc++/101231

libstdc++-v3/ChangeLog:

	* include/std/ranges (_CachedPosition::_M_get): For non-forward
	ranges, just call __builtin_unreachable.
	* testsuite/std/ranges/istream_view.cc (test05): New test.
2021-07-16 09:44:42 -04:00
..
backward
bits libstdc++: Adjust doxygen markup for unique_ptr grouping 2021-07-16 08:40:44 +01:00
c
c_compatibility
c_global
c_std
debug
decimal
experimental libstdc++: Improvements to Doxygen markup 2021-07-01 18:45:48 +01:00
ext libstdc++: Suppress pedantic warnings about __int128 2021-07-16 08:40:43 +01:00
parallel
precompiled
pstl
std libstdc++: invalid default init in _CachedPosition [PR101231] 2021-07-16 09:44:42 -04:00
tr1
tr2
Makefile.am
Makefile.in