Skip to content
Snippets Groups Projects
Commit 81c6c99e authored by Patrick Palka's avatar Patrick Palka
Browse files

libstdc++: Some concat_view bugfixes [PR115215, PR115218, LWG 4082]


- Use __builtin_unreachable to suppress a false-positive "control
  reaches end of non-void function" warning in the recursive lambda
  (which the existing tests failed to notice since test01 wasn't
  being called at runtime)
- Relax the constraints on views::concat in the single-argument case
  as per PR115215
- Add an input_range requirement to that same case as per LWG 4082
- In the const-converting constructor of concat_view's iterator,
  don't require the first iterator to be default constructible

	PR libstdc++/115215
	PR libstdc++/115218

libstdc++-v3/ChangeLog:

	* include/std/ranges
	(concat_view::iterator::_S_invoke_with_runtime_index): Use
	__builtin_unreachable in recursive lambda to certify it always
	exits via 'return'.
	(concat_view::iterator::iterator): In the const-converting
	constructor, direct initialize _M_it.
	(views::_Concat::operator()): Adjust constraints in the
	single-argument case as per LWG 4082.
	* testsuite/std/ranges/concat/1.cc (test01): Call it at runtime
	too.
	(test04): New test.

Reviewed-by: default avatarTomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: default avatarJonathan Wakely <jwakely@redhat.com>
parent 7439febd
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment