1// Origin PR c++/47291
2// { dg-options "-g -dA" }
3// { dg-do compile }
4
5struct S;
6template< int S::* cst> struct D {};
7
8struct S
9{
10  int i;
11  D < &S::i > di; //<-- folding &S::i was failing
12                  // because i has no offset as S is not laid out yet
13};
14
15int
16main()
17{
18  S s;
19  return s.i;
20}
21
22// { dg-final { scan-assembler-times "DIE \\(\[^\n\r\]*\\) DW_TAG_template_value_param" 1 } }
23