https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87957
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> --- With current trunk, I still see following problem: $ cat 1.ii enum a {} b; $ cat 2.ii class a { int *b() const; }; int *a::b() const { return 0; } $ g++ -flto [12].ii 1.ii:1:6: warning: type ‘a’ violates the C++ One Definition Rule [-Wodr] 1 | enum a {} b; | ^ 1.ii:1:6: note: a different type is defined in another translation unit during IPA pass: pure-const lto1: internal compiler error: tree check: expected enumeral_type, have record_type in free_enum_values, at ipa-devirt.c:2276 0x6de7c0 tree_check_failed(tree_node const*, char const*, int, char const*, ...) /home/marxin/Programming/gcc/gcc/tree.c:9657 0x6413a6 tree_check(tree_node*, char const*, int, char const*, tree_code) /home/marxin/Programming/gcc/gcc/tree.h:3154 0x6413a6 free_enum_values /home/marxin/Programming/gcc/gcc/ipa-devirt.c:2276 0xa34174 build_type_inheritance_graph() /home/marxin/Programming/gcc/gcc/ipa-devirt.c:2292 0xa6d852 symbol_table::remove_unreachable_nodes(_IO_FILE*) /home/marxin/Programming/gcc/gcc/ipa.c:310 0x7b3832 read_cgraph_and_symbols /home/marxin/Programming/gcc/gcc/lto/lto.c:3017 0x7b3832 lto_main() /home/marxin/Programming/gcc/gcc/lto/lto.c:3401