summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-6.C
blob: 99bbba3da8d4113240221abd49fea56f8ce2ef2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/30161
// { dg-options "-g -dA -fno-merge-debug-strings" }
// { dg-final { scan-assembler-times "DW_TAG_GNU_template_template_param" 2 } }
// { dg-final { scan-assembler-times "\"vector.0\".*?DW_AT_GNU_template_name" 1 } }
// { dg-final { scan-assembler-times ".ascii \"U.0\".*?DW_AT_name" 1 } }

template <class T>
struct vector_base
{

    static int get_sizeof_t()
    {
      return 0;
    }
};

template <class T>
struct vector : public vector_base<T>
{
    static int get_sizeof_t()
    {
        return sizeof (T);
    }
    T member1;
    T member2;
};

template <template <class T> class U>
int
bar()
{
    return U<int>::get_sizeof_t();
}

int i = bar<vector>();