https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103879

--- Comment #7 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to Patrick Palka from comment #6)
> Reduced C++14 rejects-valid testcase:
> 
> struct A {
>   int n = 42;
> };
> 
> struct B : A { };
> 
> struct C {
>   B b;
> };
> 
> constexpr int f() {
>   C c;
>   A& a = static_cast<A&>(c.b);
>   B& b = static_cast<B&>(a);
>   return b.n;
> }
> 
> static_assert(f() == 42, "");

Is this the same issue?

#include <string>
#include <ranges>

int main() {
  using namespace std::string_literals;
  static_assert(std::ranges::distance(
      std::views::iota(0, 2) | std::ranges::views::transform([](int) { return
""s; })
                             | std::ranges::views::join));
}

https://godbolt.org/z/8nve43zvW

Reply via email to