blob: 17ca6f22c50e361a82326ec924900b5390aa5fe6 [file] [log] [blame]
// { dg-do compile { target c++14 } }
template <class T, class U> struct ST;
template <class T> struct ST<T,T> {};
int g(int);
char& g(char);
double&& g(double);
template <class T> auto&& f(T t)
{ return g(t); } // { dg-warning "reference to temporary" }
int main()
{
ST<decltype(f(1)),int&&>();
ST<decltype(f('\0')),char&>();
ST<decltype(f(1.0)),double&&>();
}