Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/cpp0x/range-for20.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// PR c++/49834 // PR c++/50020 // { dg-do compile { target c++11 } } struct A { template <typename T> T get_value() const; }; struct B { A first, second; }; struct C { B* begin() const; B* end() const; }; template <typename Ret> struct D { Ret f(const C &p) { for (const B &i: p) // OK i.second.get_value<int>(); for (const auto &i: p) // ERROR i.second.get_value<int>(); return Ret(0); } }; void g() { D<int>().f(C()); }