Skip to content

CWG3198 [except.ctor] Stack unwinding when no matching handler is found is ill-defined #915

Description

@hubert-reinterpretcast

Full name of submitter (unless configured in github; will be published with the issue): Hubert Tong

Reference (section label): [except.ctor], [except.handle], [except.terminate]

Link to reflector thread (if any): N/A

Issue description:
https://wg21.link/except.ctor#2 describes stack unwinding with the assumption that there is a try block. When no matching handler is found but stack unwinding still occurs (instead of being omitted by calling std::terminate immediately), there is no try block corresponding to the implicit handler.

Suggested resolution:

  1. Explicitly identify where the implicit try block is for the applicable cases in https://wg21.link/except.terminate#1.
  2. Update https://wg21.link/except.handle#6 to end the search when the implicit try block is encountered.
  3. Remove any wording (including in the note in https://wg21.link/except.terminate#1) that separately describes calling std::terminate if the condition implies that no matching handler was found.

Activity

  1. changed the title [-][except.ctor] Stack unwinding when no matching handler is found is ill-defined[/-] [+]CWG3198 [except.ctor] Stack unwinding when no matching handler is found is ill-defined[/+] on Jun 8, 2026
  2. jensmaurer commented on Jun 8, 2026

    @jensmaurer
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions