Open socketpair opened 1 month ago
At this time you can write char newchar[N + N2 - 1];
instead, which is shorter.
Slightly reduced example (Godbolt link):
#include <cstddef>
#include <type_traits>
template <std::size_t N>
struct record {
consteval record(std::integral_constant<std::size_t, N>) {}
template <std::size_t N2>
consteval std::size_t test_with(const record<N2> other) const {
constexpr auto len = size() + other.size() + 1; // HERE
return len;
}
consteval std::size_t size() const { return N - 1; }
};
template <record Foo>
consteval auto test_two_records() {
return Foo.test_with(Foo);
}
int main() {
constexpr auto n = test_two_records<std::integral_constant<std::size_t, 42>{}>();
}
I believe this is P2280R4 which is tracked in #63139 and will be fixed by #95474.
@frederick-vs-ja Thank you, I already know how to fix. I just reported obvious bug in Clang.
@llvm/issue-subscribers-clang-frontend
Author: Коренберг Марк (socketpair)
Related: #102970
@shafik
https://godbolt.org/z/dKE6sa4PW