gcc/testsuite/g++.dg/template/deduce1.C
raw| 1 | // { dg-do run } |
| 2 | |
| 3 | // Copyright (C) 2002 Free Software Foundation, Inc. |
| 4 | // Contributed by Nathan Sidwell 13 Sep 2002 <[email protected]> |
| 5 | |
| 6 | template <typename T> int Foo (T const *) |
| 7 | { |
| 8 | return 1; |
| 9 | } |
| 10 | template <typename T> int Foo (T const &) |
| 11 | { |
| 12 | return 2; |
| 13 | } |
| 14 | template <typename T, __SIZE_TYPE__ I> int Foo (T const (&ref)[I]) |
| 15 | { |
| 16 | return 0; |
| 17 | } |
| 18 | |
| 19 | int main () |
| 20 | { |
| 21 | static int array[4] = {}; |
| 22 | |
| 23 | return Foo (array); |
| 24 | } |
| 25 |