[Bug libstdc++/119121] New: subrange conversion to tuple-like does not work

tkaminsk at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 5 09:54:26 GMT 2025


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

            Bug ID: 119121
           Summary: subrange conversion to tuple-like does not work
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkaminsk at gcc dot gnu.org
  Target Milestone: ---

The following code does not compile:
```
#include <utility>
#include <ranges>

int main() {
    std::ranges::subrange<int*> s1, s2;
    std::pair<int*, int*> p = s1;
}
```
https://godbolt.org/z/a7nhP94Tz

This produces error:
<source>: In function 'int main()':
<source>:6:31: error: conversion from 'std::ranges::subrange<int*>' to
non-scalar type 'std::pair<int*, int*>' requested
    6 |     std::pair<int*, int*> p = s1;


More information about the Gcc-bugs mailing list