Created on 2023-07-17.00:00:00 last changed 16 months ago
CWG 2023-08-25
The first change has consensus and is progressed via issue 2785; the second change should use an approach of recursive decomposition for requires-expression, similar to other paragraphs in 13.8.3.4 [temp.dep.constexpr]. The implementation divergence is believed to be an independent bug in one implementation.
Suggested resolution:
Change in 13.8.3.3 [temp.dep.expr] paragraph 4 as follows:
Expressions of the following forms are never type-dependent (because the type of the expression cannot be dependent):... noexcept ( expression ) requires-expression
Insert a new paragraph before 13.8.3.4 [temp.dep.constexpr] paragraph 5:
A requires-expression is value-dependent if it depends on a template parameter.
An expression of the form &qualified-id where the qualified-id names a dependent member ...
Consider:
template<typename T> struct A { static_assert(sizeof(T) == 3); // #1 }; template<bool B> struct C { static_assert(B); // #2 }; template<typename T, typename U> int f(typename C<requires { typename T::type; }>::type, typename A<T>::type, U); int i = f<char>(0, 1, 2);
Is the requires-expression value-dependent after substituting the explicit template argument, thus failing at #2 instead of at #1?
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-08-26 21:49:54 | admin | set | messages: + msg7406 |
2023-07-18 19:26:28 | admin | set | messages: + msg7386 |
2023-07-17 00:00:00 | admin | create |