Title
Make a type-requirement a type-only context
Status
drwp
Section
13.8.1 [temp.res.general]
Submitter
Barry Revzin

Created on 2023-10-10.00:00:00 last changed 8 months ago

Messages

Date: 2023-10-20.21:07:14

Proposed resolution (approved by CWG 2023-10-20):

  1. Change in 7.5.8.3 [expr.prim.req.type] paragraph 1 as follows:

    A type-requirement asserts the validity of a type. The component names of a type-requirement are those of its nested-name-specifier (if any) and type-name. [Note 1: The enclosing requires-expression will evaluate to false if substitution of template arguments fails. —end note]
  2. Change in 13.8.1 [temp.res.general] paragraph 4 as follows:

    A qualified or unqualified name is said to be in a type-only context if it is the terminal name of
    • a typename-specifier, type-requirement, nested-name-specifier, elaborated-type-specifier, class-or-decltype, or
    • ...
Date: 2023-11-15.00:00:00

[Accepted as a DR at the November, 2023 meeting.]

Consider:

  template <typename T>
  concept C = requires {
    typename T::type<void>;   // template required?
  };

There is implementation divergence: gcc accepts, clang and MSVC reject.

A type-requirement ought to be a type-only context.

History
Date User Action Args
2024-04-05 21:43:46adminsetstatus: dr -> drwp
2023-12-19 10:15:28adminsetstatus: ready -> dr
2023-12-02 15:54:05adminsetstatus: tentatively ready -> ready
2023-10-20 21:07:14adminsetmessages: + msg7474
2023-10-20 21:07:14adminsetstatus: open -> tentatively ready
2023-10-10 00:00:00admincreate