https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119906
Bug ID: 119906
Summary: error: '<expression error>' in namespace 'std' does
not name a type
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
Not sure if there is already a similar duplicate.
https://godbolt.org/z/W8sbx3hnn
#include <ranges>
#include <type_traits>
template<class R>
struct view {
R r;
static constexpr bool empty_r =
decltype([](R& r) -> std::bool_constant<std::ranges::size(r) == 0> {
return {};
}(std::declval<R&>())){};
};
static_assert(
view<std::ranges::empty_view<int>>::empty_r);