]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add comment for assertion
authorMarc Poulhiès <poulhies@adacore.com>
Mon, 6 Nov 2023 10:16:40 +0000 (11:16 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 28 Nov 2023 09:35:48 +0000 (10:35 +0100)
Add possible cause for a failed assertion.

gcc/ada/

* gcc-interface/utils2.cc (build_simple_component_ref): Add
comment on assertion.

gcc/ada/gcc-interface/utils2.cc

index 95bbce2f1b4fad32751411eb417fac1a9b3141a8..6a951093ff8f489a96a059c2728452a7c544f5b9 100644 (file)
@@ -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.  */