OSDN Git Service

Emit DWARF for template parameters (PR debug/30161)
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / debug / dwarf2 / template-func-params-6.C
1 // Contributed by Dodji Seketeli <dodji@redhat.com>
2 // Origin PR debug/30161
3 // { dg-options "-g -dA" }
4 // { dg-final { scan-assembler-times "DW_TAG_GNU_template_template_param" 2 } }
5 // { dg-final { scan-assembler-times "DW_AT_GNU_template_name: \"vector\"" 1 } }
6 // { dg-final { scan-assembler-times ".ascii \"U.0\".*?DW_AT_name" 1 } }
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