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

            Bug ID: 110555
           Summary: internal compiler error: Segmentation fault when using
                    std::ranges::range auto as a template parameter
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

Original from
https://stackoverflow.com/questions/76617167/check-if-a-type-is-convertible-to-a-range-in-c20

#include <ranges>

template<class R>
void print(R&& range) {
  if (std::is_same_v<R, std::ranges::range auto>) {
    // ...
  }
}

int main() {
  int arr[] = {0, 1, 2};
  print(arr);
}

https://godbolt.org/z/4Wq5d6z3c

Reply via email to