Skip to content

Delete the destructor of proxy for facades that forbid destruction - #111

Draft
mingxwa wants to merge 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/destroy
Draft

mingxwa wants to merge 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/destroy

Conversation

@mingxwa

@mingxwa mingxwa commented Nov 18, 2026 •

Copy link
Copy Markdown
Member
  • Added a deleted destructor for F::destructibility == lifetime_requirement::none, because proxy was ill-formed for such a facade when no destructor could be selected. It is declared before the other destructors, because NVHPC 26.3 otherwise selected it while checking *this = proxy{rhs} in a member template and rejected code that never used such a facade.
  • Stopped delegating in proxy(std::nullptr_t), because GCC, Clang and MSVC reject a delegating constructor of a class whose destructor is deleted. The destructor would run if the delegating constructor exited via an exception ([except.ctor]/4).
  • Excluded the relocating swap when destruction is forbidden, because it needs a temporary proxy.
  • Added static assertions for the deleted destructor and the swap constraint, and a test that constructs such a proxy with a new-expression.

- Added a deleted destructor for `F::destructibility == lifetime_requirement::none`, because `proxy` was ill-formed for such a facade when no destructor could be selected. It is declared before the other destructors, because NVHPC 26.3 otherwise selected it while checking `*this = proxy{rhs}` in a member template and rejected code that never used such a facade.
- Stopped delegating in `proxy(std::nullptr_t)`, because GCC, Clang and MSVC reject a delegating constructor of a class whose destructor is deleted. The destructor would run if the delegating constructor exited via an exception ([except.ctor]/4).
- Excluded the relocating `swap` when destruction is forbidden, because it needs a temporary `proxy`.
- Added static assertions for the deleted destructor and the `swap` constraint, and a test that constructs such a `proxy` with a *new-expression*.
@mingxwa
mingxwa force-pushed the user/mingxwa/destroy branch from b9c93a4 to 898f5b1 Compare November 18, 2026 15:07
@mingxwa
mingxwa marked this pull request as draft November 18, 2026 21:19
@mingxwa
mingxwa force-pushed the user/mingxwa/destroy branch from 898f5b1 to b881717 Compare November 19, 2026 05:57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant