gcc/testsuite/g++.dg/debug/dwarf2/template-params-10.C
raw| 1 | // Origin PR c++/47291 |
| 2 | // { dg-options "-gdwarf-2 -dA" } |
| 3 | // { dg-do compile } |
| 4 | |
| 5 | struct S; |
| 6 | template< int S::* cst> struct D {}; |
| 7 | |
| 8 | struct 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 | |
| 15 | int |
| 16 | main() |
| 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 } } |