| 1 |
// Contributed by Dodji Seketeli <[email protected]> |
| 2 |
// Origin PR debug/30161 |
| 3 |
// { dg-options "-gdwarf-2 -dA -fno-merge-debug-strings" } |
| 4 |
// { dg-final { scan-assembler-times "DW_TAG_GNU_template_template_param" 2 } } |
| 5 |
// { dg-final { scan-assembler-times "\"vector.0\".*?DW_AT_GNU_template_name" 1 } } |
| 6 |
// { dg-final { scan-assembler-times ".ascii \"U.0\".*?DW_AT_name" 1 { xfail { powerpc-ibm-aix* } } } } |
| 7 |
|
| 8 |
template <class T> |
| 9 |
struct vector_base |
| 10 |
{ |
| 11 |
|
| 12 |
static int get_sizeof_t() |
| 13 |
{ |
| 14 |
return 0; |
| 15 |
} |
| 16 |
}; |
| 17 |
|
| 18 |
template <class T> |
| 19 |
struct vector : public vector_base<T> |
| 20 |
{ |
| 21 |
static int get_sizeof_t() |
| 22 |
{ |
| 23 |
return sizeof (T); |
| 24 |
} |
| 25 |
T member1; |
| 26 |
T member2; |
| 27 |
}; |
| 28 |
|
| 29 |
template <template <class T> class U> |
| 30 |
int |
| 31 |
bar() |
| 32 |
{ |
| 33 |
return U<int>::get_sizeof_t(); |
| 34 |
} |
| 35 |
|
| 36 |
int i = bar<vector>(); |
| 37 |
|
| 38 |
|