1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Wuninitialized" } */
4 enum demangle_component_type
{
5 DEMANGLE_COMPONENT_NAME
,
6 DEMANGLE_COMPONENT_REFERENCE
8 struct demangle_component
{
9 enum demangle_component_type type
;
10 } d_print_comp_inner_mod_inner
, *d_print_comp_inner_dc
;
12 struct d_print_mod
*next
;
16 struct d_print_mod
*modifiers
;
18 void d_print_comp_inner(struct d_print_info
*dpi
)
20 int saved_templates
, need_template_restore
= 0;
21 switch (d_print_comp_inner_dc
->type
) {
22 case DEMANGLE_COMPONENT_NAME
:
24 case DEMANGLE_COMPONENT_REFERENCE
:
25 saved_templates
= dpi
->templates
;
26 need_template_restore
= 1;
28 struct d_print_mod dpm
;
29 dpm
.next
= dpi
->modifiers
;
30 d_print_comp_inner_mod_inner
= *d_print_comp_inner_dc
;
31 d_print_comp_inner(dpi
);
32 dpi
->modifiers
= dpm
.next
;
33 if (need_template_restore
)
34 dpi
->templates
= saved_templates
; /* { dg-bogus "uninitialized" } */