This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


2513. Ambiguity with requires-clause and operator-function-id

Section: 11.4.8.3  [class.conv.fct]     Status: open     Submitter: Richard Smith     Date: 2021-12-09

An ambiguity can occur with a requires-clause that ends in an operator-function-id:

  template<typename T> requires T::operator int
  const // part of operator-type-id or return type?
  unsigned f();

  template<typename T> requires T::operator int
  [[attr]] // appertains to type int or to declaration of g?
  void g();

Such cases are always ill-formed, because they involve an atomic constraint of non-bool type.