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

            Bug ID: 121745
           Summary: The return of get(pair<_Up, _Tp>&& __p) may be
                    ill-formed
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

From
https://stackoverflow.com/questions/79752419/type-based-stdget-for-stdpair-can-be-compiled-with-msvc-but-cannot-be-compil

#include <utility>

int main() {
  int i = 0;
  int& r = i;
  std::pair<int&, int> p{r, i};
  int& ret = std::get<int&>(std::move(p));
}

https://godbolt.org/z/evs9sT4xs

Reply via email to