https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98463
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- With the patch for C++14 and older the problem is that the empty base has no FIELD_DECL in the RECORD_TYPE at all, so it then doesn't find anything. So for the empty_base && lval case it might be better to return some tree that would make it clear to the caller that the code is valid but that it shouldn't really store anything into it. But still, for C++17 and onwards, we shouldn't be setting empty_base for the lval case if we can find the FIELD_DECL for it (so perhaps for lval move the is_empty_class check to the end) and otherwise figure out what to return. A freshly created VAR_DECL, or one that is cached (same VAR_DECL for the same type), something else?