1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// PR c++/89070 - bogus [[nodiscard]] warning in SFINAE. // { dg-do compile { target c++11 } } struct A { [[nodiscard]] static int match() { return 42; } }; template<typename T> auto g() -> decltype( T::match(), bool() ) { return T::match(); } int main() { g<A>(); }