diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/overload/template5.C')
-rw-r--r-- | gcc/testsuite/g++.dg/overload/template5.C | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/overload/template5.C b/gcc/testsuite/g++.dg/overload/template5.C new file mode 100644 index 00000000000..b1dc65ebe18 --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/template5.C @@ -0,0 +1,15 @@ +// { dg-do compile } + +template<typename T> +int low(T a, T b, T c) { return a + b + c; } // { dg-message "template" } + +template<typename T> +int high(T a, T b, T c) { return a + b + c; } // { dg-message "template" } + +int test (void) +{ + low (5, 6); // { dg-error "no matching function" } + // { dg-message "(candidate|3 arguments, 2 provided)" "" { target *-*-* } 11 } + high (5, 6, 7, 8); // { dg-error "no matching function" } + // { dg-message "(candidate|3 arguments, 4 provided)" "" { target *-*-* } 13 } +} |