gcc/testsuite/g++.old-deja/g++.brendan/template24.C
raw| 1 | // { dg-do run } |
| 2 | // GROUPS passed templates |
| 3 | extern "C" int printf (const char *, ...); |
| 4 | |
| 5 | template <class F> |
| 6 | class Temp |
| 7 | { |
| 8 | F func_; |
| 9 | public: |
| 10 | Temp (F f) :func_(f) {} |
| 11 | }; |
| 12 | |
| 13 | int func (int h = 1, int z = 2) { return h+z; } |
| 14 | |
| 15 | int main () |
| 16 | { |
| 17 | Temp<int(*)(int, int)> temp (func); |
| 18 | |
| 19 | printf ("PASS\n"); |
| 20 | return 0; |
| 21 | } |