cplusplus / cplusplus/draft

[except.handle] p9 handler vs. implicit handler

Open
#5,236 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

[except.handle] p7 says

A handler is considered active when initialization is complete for the parameter (if any) of the catch clause. Also, an implicit handler is considered active when the function std​::​terminate is entered due to a throw.

Since the implicit handler can be considered active, it should also be considered as a matching handler. Simultaneously, [except.handle] p9 sates

If no matching handler is found, the function std​::​terminate is invoked;

Then, whether the implicit handle can be found? this issue is caused by that [except.handle] p7 and [except.handle] p9 have a cross-dependence. I think we should improve [except.handle] p9 to eliminate the dependence:

If no matching handler other than the implicit handler is found, the function std​::​terminate is invoked;

which means, the "the matching handler" case only considers the lexcially handlers.

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

Start with [except.handle] paragraphs 7 and 9 in the C++ draft and compare how “active” and “matching” handlers interact, especially when std::terminate is entered after a throw. Check the surrounding exception-handling wording and determine whether p9 should explicitly exclude the implicit handler; done means the paragraphs no longer depend circularly on each other and preserve the intended distinction.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, tex
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.