1 2 3 4 5 6 7 8 9 10 11 12 13 14
// PR c++/101051 // { dg-do compile { target c++11 } } template <class T> class Foo { constexpr operator T() -> T {} // { dg-error "trailing return" } }; struct S { operator int() const -> double; // { dg-error "trailing return" } }; class A { operator auto*() -> int; }; // { dg-error "auto|trailing return" }