gcc/testsuite/g++.old-deja/g++.pt/spec10.C
raw| 1 | // { dg-do run } |
| 2 | extern "C" void abort(); |
| 3 | |
| 4 | template <class T> |
| 5 | struct S |
| 6 | { |
| 7 | template <int i> |
| 8 | int f(int j) { abort(); return 0; } |
| 9 | }; |
| 10 | |
| 11 | template <> |
| 12 | template <> |
| 13 | int S<double>::f<7>(int j) { return j + 7; } |
| 14 | |
| 15 | template <> |
| 16 | template <> |
| 17 | int S<double>::f<8>(int j) { return j + 8; } |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | S<double> s; |
| 22 | |
| 23 | if (s.f<7>(3) != 10) |
| 24 | abort(); |
| 25 | |
| 26 | if (s.f<8>(3) != 11) |
| 27 | abort(); |
| 28 | } |