From: Marc Poulhiès Date: Mon, 6 Nov 2023 10:16:40 +0000 (+0100) Subject: ada: Add comment for assertion X-Git-Tag: basepoints/gcc-15~4224 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60123b134bf3d925c5d696b5fcd9adfc8f4b54e7;p=thirdparty%2Fgcc.git ada: Add comment for assertion Add possible cause for a failed assertion. gcc/ada/ * gcc-interface/utils2.cc (build_simple_component_ref): Add comment on assertion. --- diff --git a/gcc/ada/gcc-interface/utils2.cc b/gcc/ada/gcc-interface/utils2.cc index 95bbce2f1b4f..6a951093ff8f 100644 --- a/gcc/ada/gcc-interface/utils2.cc +++ b/gcc/ada/gcc-interface/utils2.cc @@ -2021,7 +2021,10 @@ build_simple_component_ref (tree record, tree field, bool no_fold) /* The failure of this assertion will very likely come from a missing insertion of an explicit dereference. */ - gcc_assert (RECORD_OR_UNION_TYPE_P (type) && COMPLETE_TYPE_P (type)); + gcc_assert (RECORD_OR_UNION_TYPE_P (type)); + + /* The type must be frozen at this point. */ + gcc_assert (COMPLETE_TYPE_P (type)); /* Try to fold a conversion from another record or union type unless the type contains a placeholder as it might be needed for a later substitution. */