https://gcc.gnu.org/g:023a5dd187b1b08979bc0654334e75e7b2c15eaa

commit r15-4926-g023a5dd187b1b08979bc0654334e75e7b2c15eaa
Author: Piotr Trojanek <troja...@adacore.com>
Date:   Tue Oct 15 10:01:32 2024 +0200

    ada: Remove special case for the size of a string literal subtype
    
    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.

Diff:
---
 gcc/ada/gcc-interface/decl.cc | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 3404b747ddf8..f5188ddc8bca 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -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 &" : "&";

Reply via email to