gcc/testsuite/g++.dg/template/instantiate11.C
raw| 1 | // PR c++/42608 |
| 2 | // { dg-do compile } |
| 3 | |
| 4 | template <class U, class V> |
| 5 | struct A; |
| 6 | |
| 7 | template <class V> |
| 8 | struct A<int, V> |
| 9 | { |
| 10 | void f (); |
| 11 | }; |
| 12 | |
| 13 | template struct A<int, int>; |
| 14 | |
| 15 | int |
| 16 | main () |
| 17 | { |
| 18 | A<int, int> a; |
| 19 | a.f (); |
| 20 | return 0; |
| 21 | } |
| 22 | |
| 23 | // Make sure we get undefined reference error if |
| 24 | // A<int, int>::f () isn't instantiated elsewhere. |
| 25 | // { dg-final { scan-assembler-not "weak\[\n\t\]*_ZN1AIiiE1fEv" } } |