Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wdangling-reference10.C
blobcc92e6b66e3d2a4b5c289caf4b07659b5c4871da
1 // PR c++/107532
2 // { dg-do compile { target c++20 } }
3 // { dg-options "-Wdangling-reference" }
4 // { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } }
6 #include <span>
7 #include <vector>
9 void f(const std::vector<int>& v)
11   const int& r = std::span<const int>(v)[0]; // { dg-bogus "dangling reference" }
12   (void) r;