1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// PR c++/45908 // Testcase by Jonathan Wakely <redi@gcc.gnu.org> // { dg-do compile } // { dg-options "-std=c++0x" } struct vector { struct iterator { }; struct const_iterator { }; iterator begin(); const_iterator begin() const; }; class block { vector v; auto end() const -> decltype(v.begin()) { return v.begin(); } // { dg-error "could not convert" } };