aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/auto-fn8.C
blob: 1badd6a5e81e19aeae455177fc9952d5ba1482c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// { dg-do compile { target c++1y } }

auto f() { return 42; }		// { dg-message "old declaration .auto" }
auto f();			// OK
int f();			// { dg-error "new declaration" }

template <class T> auto f(T t) { return t; }
template <class T> T f(T t);

int main()
{
  f(42);			// { dg-error "ambiguous" }
}