https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66214
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at redhat dot com --- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Jaon, the issue here is that TYPE_CANONICAL is incomplete type: <record_type 0x3fff8e94c8d0 A readonly type_5 VOID align 8 symtab 0 alias set -1 canonical type 0x3fff8e94c8d0 context <translation_unit_decl 0x3fff96fc0078 D.1> full-name "const class A" n_parents=0 use_template=0 interface-unknown reference_to_this <reference_type 0x3fff8e94ca20>> while the type itself is complete (it is a completetion of the class A provided later): <record_type 0x3fff8e94d158 value_type readonly used type_5 VOID align 8 symtab -1903885616 alias set -1 canonical type 0x3fff8e94c8d0 fields <field_decl 0x3fff8e834c00 m_upperBorder type <integer_type 0x3fff8e770690 int public type_6 SI size <integer_cst 0x3fff8e7316b0 constant 32> unit size <integer_cst 0x3fff8e7316c8 constant 4> align 32 symtab 0 alias set -1 canonical type 0x3fff8e770690 precision 32 min <integer_cst 0x3fff8e731668 -2147483648> max <integer_cst 0x3fff8e731680 2147483647> pointer_to_this <pointer_type 0x3fff8e7717a0>> private decl_3 VOID file t.C line 7 col 7 align 1 offset_align 1 context <record_type 0x3fff8e94c4e0 A> chain <type_decl 0x3fff8e834b68 A type <record_type 0x3fff8e94ceb8 A> nonlocal decl_4 VOID file t.C line 6 col 9 align 1 context <record_type 0x3fff8e94c4e0 A> result <record_type 0x3fff8e94c4e0 A> >> context <translation_unit_decl 0x3fff96fc0078 D.1> full-name "const value_type" n_parents=0 use_template=0 interface-unknown reference_to_this <reference_type 0x3fff8e94d200>> Shouldn't the canonical type be always the complete variant of the type?