Open
Description
#include <tuple>
struct A {
template<int> friend int get(A);
};
struct Conv {
constexpr operator int() { return 2; }
};
template<> struct std::tuple_size<A> {
static Conv& value; // no definition
};
template<int N> struct std::tuple_element<N, A> {
using type = int;
};
auto [a,b] = A();
I think this TU is invalid, because tuple_size<A>::value
is not an integral constant expression.
clang++ -std=c++20 -c
rejects.
clang++ -std=c++23 -c
accepts.
Is this intended for P2280? But other compilers support P2280 too, and they all reject this tuple_size
code.
I think #132463 could relate.