Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.dg / template / overload12.C
blob43898efebde63443b3c28438238f687770eb9cde
1 // { dg-do compile }
3 struct S {int x; int y;};
4 template<typename T>
5 int foo(T a, T b) {return a + b;} // { dg-message "template" }
6 template<typename T, typename T2>
7 int foo(T a, T2& b, T2 c) {return a + b;}  // { dg-message "template" }
8 int foo(char*, S&); // { dg-message "foo" }
9 // { dg-message "candidate expects 2 arguments, 3 provided" "arity" { target *-*-* } .-1 }
11 void foo2(int x)
13   S s={1,2};
14   char c;
15   foo(c, 2, c); // { dg-error "no matching function" }
16   // { dg-message "(candidate|deduced conflicting types for)" "candidate note" { target *-*-* } .-1 }