]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove special case for the size of a string literal subtype
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 15 Oct 2024 08:01:32 +0000 (10:01 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 4 Nov 2024 15:57:59 +0000 (16:57 +0100)
Apparently we no longer need to ignore string literal subtypes case
when validating size of a type entity.

Code cleanup; behavior appears to be unaffected.

gcc/ada/ChangeLog:

* gcc-interface/decl.cc (gnat_to_gnu_entity): Remove special
case for string literal subtypes.

gcc/ada/gcc-interface/decl.cc

index 3404b747ddf8dc22cb0c22888a80ba6e168be443..f5188ddc8bcac088dc864ea66cb3479bf994a5c4 100644 (file)
@@ -4457,12 +4457,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
       process_attributes (&gnu_type, &attr_list, false, gnat_entity);
 
       /* See if a size was specified, by means of either an Object_Size or
-         a regular Size clause, and validate it if so.
-
-        ??? Don't set the size for a String_Literal since it is either
-        confirming or we don't handle it properly (if the low bound is
-        non-constant).  */
-      if (!gnu_size && kind != E_String_Literal_Subtype)
+         a regular Size clause, and validate it if so.  */
+      if (!gnu_size)
        {
          const char *size_s = "size for %s too small{, minimum allowed is ^}";
          const char *type_s = is_by_ref ? "by-reference type &" : "&";