gcc/testsuite/g++.old-deja/g++.robertl/eb125.C
raw| 1 | // { dg-do assemble } |
| 2 | |
| 3 | struct test_box |
| 4 | { |
| 5 | void print(void); |
| 6 | }; |
| 7 | |
| 8 | void test<class BOX> (test_box *); // { dg-error "" } illegal code |
| 9 | |
| 10 | class test_square |
| 11 | { |
| 12 | friend void test<class BOX> (test_box *); // { dg-error "" } does not match |
| 13 | } // { dg-error "after class definition" } |
| 14 | |
| 15 | |
| 16 | |
| 17 | template <class BOX> void test(BOX *the_box) |
| 18 | {x // { dg-error "not declared in this scope" } |
| 19 | the_box->print(); |
| 20 | } |
| 21 | |
| 22 | template void test<> (test_box *); |