cplusplus / cplusplus/draft

[basic.life][class.dtor] Seemingly redundant normative specification for undefined behavior about double destruction

Open
#6,374 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

[basic.life]/9 and [class.dtor]/18 seem to be normatively redundant, because

  • [basic.life]/1.4 already specifies that a destructor call ends the lifetime of a class object, and
  • [basic.life]/6.2 and [basic.life]/7.2 already specifies that calling a non-static member function, including destructor, for an out-of-lifetime object is undefined behavior.

Originally discovered by @sergey-anisimov-dev in https://github.com/cplusplus/CWG/issues/361#issuecomment-1634583516.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare [basic.life]/1.4, /6.2, /7.2, and /9 with [class.dtor]/18, starting from the linked standard clauses and the discussion in CWG issue 361. Determine whether the double-destruction wording is genuinely redundant and document the agreed resolution; done means the normative text and issue discussion no longer contain unresolved duplication.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.