libstdc++: [_GLIBCXX_DEBUG] Enhance __gnu_debug::inplace_vector implementation #230

Open
fdumont wants to merge 1 commit from fdumont/gcc-TEST:debug_inplace_vector into trunk
Member

Review invalidation of iterators to use a RAII approach. A guard type has been
implemented that is in charge of running an invalidation policy on destruction
when not in a constant evaluation context.

libstdc++-v3/ChangeLog:

* include/debug/assertions.h (_GLIBCXX_DEBUG_STD_C): New.
* include/debug/inplace_vector (__gnu_debug::_Inplace_vector_guard): New.
(inplace_vector::_InvalidatePolicy): New.
(inplace_vector::_InvalidateGuard): New.
(inplace_vector::_InvalidateAfterNthPolicy): New.
(inplace_vector::_InvalidateAfterNthGuard): New.
[_GLIBCXX_DEBUG_PEDANTIC](inplace_vector::_PedanticInvalidatePolicy): New.
(inplace_vector::_AssignGuard): New.
(inplace_vector): Adapt using latter guards.
* testsuite/23_containers/inplace_vector/debug/initializer_list.cc: New test case.
* testsuite/23_containers/inplace_vector/debug/initializer_list_pedantic.cc:
New test case.

Thanks for taking the time to contribute to GCC!

Please be advised that https://forge.sourceware.org/ is currently a trial
that is being used by the GCC community to experiment with a new workflow
based on pull requests.

Pull requests sent here may be forgotten or ignored. Patches that you want to
propose for inclusion in GCC should use the existing email-based workflow,
see https://gcc.gnu.org/contribute.html

Review invalidation of iterators to use a RAII approach. A guard type has been implemented that is in charge of running an invalidation policy on destruction when not in a constant evaluation context. libstdc++-v3/ChangeLog: * include/debug/assertions.h (_GLIBCXX_DEBUG_STD_C): New. * include/debug/inplace_vector (__gnu_debug::_Inplace_vector_guard): New. (inplace_vector::_InvalidatePolicy): New. (inplace_vector::_InvalidateGuard): New. (inplace_vector::_InvalidateAfterNthPolicy): New. (inplace_vector::_InvalidateAfterNthGuard): New. [_GLIBCXX_DEBUG_PEDANTIC](inplace_vector::_PedanticInvalidatePolicy): New. (inplace_vector::_AssignGuard): New. (inplace_vector): Adapt using latter guards. * testsuite/23_containers/inplace_vector/debug/initializer_list.cc: New test case. * testsuite/23_containers/inplace_vector/debug/initializer_list_pedantic.cc: New test case. Thanks for taking the time to contribute to GCC! Please be advised that https://forge.sourceware.org/ is currently a trial that is being used by the GCC community to experiment with a new workflow based on pull requests. Pull requests sent here may be forgotten or ignored. Patches that you want to propose for inclusion in GCC should use the existing email-based workflow, see https://gcc.gnu.org/contribute.html
libstdc++: [_GLIBCXX_DEBUG] Enhance __gnu_debug::inplace_vector implementation
Some checks failed
/ format-checks (pull_request) Failing after 1m14s
5c8c1a77cb
Review invalidation of iterators to use a RAII approach. A guard type has been
implemented that is in charge of running an invalidation policy on destruction
when not in a constant evaluation context.

libstdc++-v3/ChangeLog:

	* include/debug/assertions.h (_GLIBCXX_DEBUG_STD_C): New.
	* include/debug/inplace_vector (__gnu_debug::_Inplace_vector_guard): New.
	(inplace_vector::_InvalidatePolicy): New.
	(inplace_vector::_InvalidateGuard): New.
	(inplace_vector::_InvalidateAfterNthPolicy): New.
	(inplace_vector::_InvalidateAfterNthGuard): New.
	[_GLIBCXX_DEBUG_PEDANTIC](inplace_vector::_PedanticInvalidatePolicy): New.
	(inplace_vector::_AssignGuard): New.
	(inplace_vector): Adapt using latter guards.
	* testsuite/23_containers/inplace_vector/debug/initializer_list.cc: New test case.
	* testsuite/23_containers/inplace_vector/debug/initializer_list_pedantic.cc:
	New test case.
Member

Hi @fdumont. This bot helps send your PR as a patch series to the mailing list.

Next steps

  1. Write a clear PR description. It will be used as the cover letter.
  2. To CC extra people, add lines like this at the end of the PR description: CC: Reviewer1 <revi.ewer@example.com>, Reviewer2 <an.other@example.com>.
  3. To preview the emails, comment with /preview.
  4. When ready, request review in the Reviewers section. Or, if you just want to send the series, comment with /submit.
  5. Use the cover-letter links below to follow replies.
  6. For a new patch series, push your changes, update the PR description with a Changes since vX section, and comment with /submit again.

See Submitting Patches and UsingForge.

Consider joining the gcc and gcc-patches mailing lists..
For real time communication, check the gcc irc channels.

Or join #overseers on Libera Chat, particularly if this automation is not working (stay online to get replies, IRC does not save messages if people are not online).

<!-- pr-welcome --> Hi @fdumont. This bot helps send your PR as a patch series to the mailing list. ## Next steps 1. Write a clear PR description. It will be used as the cover letter. 2. To CC extra people, add lines like this **at the end** of the PR description: `CC: Reviewer1 <revi.ewer@example.com>, Reviewer2 <an.other@example.com>`. 3. To preview the emails, comment with `/preview`. 4. When ready, request review in the Reviewers section. Or, if you just want to send the series, comment with `/submit`. 5. Use the cover-letter links below to follow replies. 6. For a new patch series, push your changes, update the PR description with a `Changes since vX` section, and comment with `/submit` again. See [Submitting Patches](https://gcc.gnu.org/contribute.html#patches) and [UsingForge](https://gcc.gnu.org/wiki/UsingForge). Consider joining the [gcc and gcc-patches mailing lists.](https://gcc.gnu.org/lists.html). For real time communication, check the [gcc irc channels](https://gcc.gnu.org/wiki/GCConIRC). Or join [`#overseers`](https://web.libera.chat/#overseers) on Libera Chat, particularly if this automation is not working (stay online to get replies, IRC does not save messages if people are not online).
Some checks failed
/ format-checks (pull_request) Failing after 1m14s
This pull request has changes conflicting with the target branch.
  • libstdc++-v3/include/debug/inplace_vector
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u debug_inplace_vector:fdumont-debug_inplace_vector
git switch fdumont-debug_inplace_vector

Merge

Merge the changes and update on Forgejo.
git switch trunk
git merge --no-ff fdumont-debug_inplace_vector
git switch fdumont-debug_inplace_vector
git rebase trunk
git switch trunk
git merge --ff-only fdumont-debug_inplace_vector
git switch fdumont-debug_inplace_vector
git rebase trunk
git switch trunk
git merge --no-ff fdumont-debug_inplace_vector
git switch trunk
git merge --squash fdumont-debug_inplace_vector
git switch trunk
git merge --ff-only fdumont-debug_inplace_vector
git switch trunk
git merge fdumont-debug_inplace_vector
git push origin trunk
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gcc/gcc!230
No description provided.