2971. variant should require Destructible types

Section: 22.6.3 [variant.variant] Status: NAD Submitter: Agustín K-ballo Bergé Opened: 2017-05-31 Last modified: 2020-09-06

Priority: Not Prioritized

View all other issues in [variant.variant].

View all issues with NAD status.

Discussion:

The state of a variant is not specified if an exception is thrown during the destruction of the active alternative. Exceptions should not be allowed to escape during destruction of an object used as a variant alternative. Otherwise, it should be specified that the variant object might not hold a value.

[2017-07 Toronto Monday issue prioritization]

NAD; [res.on.functions]/2 already gives us this guarantee.

Proposed resolution:

This wording is relative to N4659.

  1. Edit 22.6.3 [variant.variant] as indicated:

    -2- All types in Types... shall be (possibly cv-qualified) object types that are not arrays, and shall satisfy the requirements of Destructible (Table 27).