summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/cpp1y/auto-fn6.C
blob: 123132ddf0c4fb68249e990b04ff6dd2e7f0ae62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { dg-do compile { target c++1y } }

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&&>();
}
OpenPOWER on IntegriCloud