summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/dwarf2/template-params-10.C
blob: c12fe3990261d51e64330c964103b30239d43004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Origin PR c++/47291
// { dg-options "-g -dA" }
// { dg-do compile }

struct S;
template< int S::* cst> struct D {};

struct S
{
  int i;
  D < &S::i > di; //<-- folding &S::i was failing
                  // because i has no offset as S is not laid out yet
};

int
main()
{
  S s;
  return s.i;
}

// { dg-final { scan-assembler-times "DIE \\(\[^\n\r\]*\\) DW_TAG_template_value_param" 1 } }