Created on 2026-03-25.00:00:00 last changed 1 week ago
CWG 2026-03-27
The status quo specification is clear that the declaration (sans the defintion) of #3 is instantiated while constructing the candidate set, causing constant evaluation of v. Constant evaluation of a contract violation requires rejection of the program per 4.1.1 [intro.compliance.general] bullet 2.3.4.
Consider:
template<class T>
constexpr int v(T x)
pre(x > 0)
{
return x; // #1
// return *T(); // #2
}
template<int> struct C;
template<class T>
constexpr int f(C<v(T())> *) { return 1; } // #3
template<class T>
constexpr int f(void*) { return 2; } // #4
static_assert(f<int>((void*)0) == 2);
In general, certain instantiations are optional; see 13.9.2 [temp.inst] paragraph 9.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-03-27 13:08:23 | admin | set | messages: + msg8527 |
| 2026-03-27 13:08:23 | admin | set | status: open -> nad |
| 2026-03-25 00:00:00 | admin | create | |