Title
Diagnosing non-bool type constraints
Status
cd6
Section
13.8 [temp.res]
Submitter
Hubert Tong

Created on 2020-04-20.00:00:00 last changed 28 months ago

Messages

Date: 2020-04-15.00:00:00

Proposed resolution (April, 2020):

Change bullet 8.2 of 13.8 [temp.res] as follows:

The program is ill-formed, no diagnostic required, if:

  • ...

  • no substitution of template arguments into a type-constraint or requires-clause would result in a valid expression any constraint-expression in the program, introduced or otherwise, has (in its normal form) an atomic constraint A where no satisfaction check of A could be well-formed and no satisfaction check of A is performed, or

  • ...

Date: 2020-11-15.00:00:00

[Accepted at the November, 2020 meeting.]

Given the following example,

  template <typename T> struct A {};
  template <typename T> void f() requires (sizeof(A<T>)) {}

the current wording does not appear to allow diagnosis of the program as ill-formed. In particular, 13.8 [temp.res] bullet 8.2 says,

The program is ill-formed, no diagnostic required, if:

  • ...

  • no substitution of template arguments into a type-constraint or requires-clause would result in a valid expression, or

  • ...

However, substitution into the requires-clause in this case would result in a valid expression, but not one that is an atomic constraint that can be checked for satisfaction.

History
Date User Action Args
2022-08-19 07:54:33adminsetstatus: drwp -> cd6
2021-02-24 00:00:00adminsetstatus: dr -> drwp
2020-12-15 00:00:00adminsetmessages: + msg6330
2020-04-20 00:00:00admincreate