https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336
--- Comment #34 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to H.J. Lu from comment #33) > (In reply to Andrew Pinski from comment #32) > > (In reply to H.J. Lu from comment #31) > > > (In reply to Andrew Pinski from comment #30) > > > > > > > > Isn't an empty record is one without any field decls? > > > > > > I thin it is language specific. > > > > How so? An record without any field decls is empty and most of the rest of > > the middle-end treats it that way. > > This is a C++ empty class with field decls from PR 68355: > > (gdb) cal debug_tree (type) > <record_type 0x7ffff164e540 integral_constant type_5 type_6 QI > size <integer_cst 0x7ffff14e5f90 type <integer_type 0x7ffff14e92a0 > bitsizetype> constant 8> > unit size <integer_cst 0x7ffff14e5fa8 type <integer_type 0x7ffff14e91f8 > sizetype> constant 1> > align 8 symtab 0 alias set -1 canonical type 0x7ffff164e540 > fields <var_decl 0x7ffff7ff9d80 value > type <boolean_type 0x7ffff164e9d8 bool readonly unsigned type_6 QI > size <integer_cst 0x7ffff14e5f90 8> unit size <integer_cst 0x7ffff14e5fa8 1> > align 8 symtab 0 alias set -1 canonical type 0x7ffff164e9d8 > precision 1 min <integer_cst 0x7ffff1506210 0> max <integer_cst > 0x7ffff1506240 1>> > readonly constant used public static tree_3 unsigned external > nonlocal decl_3 decl_6 QI file bar.ii line 4 col 24 size <integer_cst > 0x7ffff14e5f90 8> unit size <integer_cst 0x7ffff14e5fa8 1> > align 8 context <record_type 0x7ffff164e540 integral_constant> > template-info 0x7ffff164c220 > chain <type_decl 0x7ffff1645850 integral_constant type <record_type > 0x7ffff164e930 integral_constant> > external nonlocal suppress-debug decl_4 VOID file bar.ii line 3 > col 1 > align 8 context <record_type 0x7ffff164e540 integral_constant> > result <record_type 0x7ffff164e540 integral_constant> > chain <type_decl 0x7ffff16458e8 value_type>>> context > <translation_unit_decl 0x7ffff14f1168 D.1> > full-name "struct integral_constant<bool, true>" > X() has-type-conversion X(constX&) this=(X&) n_parents=0 use_template=1 > interface-unknown > pointer_to_this <pointer_type 0x7ffff1650000> reference_to_this > <reference_type 0x7ffff1650498> chain <type_decl 0x7ffff1645720 > integral_constant>> > (gdb) So no FIELD_DECL as part of fields; only var or type or method_decl?