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

--- Comment #11 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
What still remains to be fixed is:

// PR c++/78244
// { dg-do compile { target c++11 } }

struct S { S(int); int d; };

template <typename T>
auto f1() -> decltype(S{2.0}, void()) { } // { dg-error "narrowing conversion"
}

template <typename T>
auto f2() -> decltype(S{2.0}, 1) { return 1; } // { dg-error "narrowing
conversion" }

template <typename T>
auto f3() -> decltype(void(), S{2.0}, 1) { return 1; } // { dg-error "narrowing
conversion" }

template <typename T>
auto f4() -> decltype((S{2.0}, 1)) { return 1; } // { dg-error "narrowing
conversion" }

Reply via email to