This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-11-11
According to 13.4.3 [temp.arg.nontype] paragraph 1 (newly revised by the adoption of paper N4268),
For a non-type template-parameter of reference or pointer type, the value of the constant expression shall not refer to (or for a pointer type, shall not be the address of):
a subobject (6.7.2 [intro.object]),
...
This change breaks an example like
template<int *p> struct X {}; int arr[32]; X<arr> x;
because the array-to-pointer decay produces a pointer to the first element, which is a subobject.
Suggested resolution:
Change the referenced bullet to read:
a subobject (6.7.2 [intro.object]) that is not the first element of a complete object of array type,
Note that this resolution also allows an example like
template<char &p> struct S { }; char arr[2]; S<arr[0]> s_arr;
which may not be exactly what we want.
See also issue 2401.