https://gcc.gnu.org/g:cd78ae1d1665b7e7c6cc46996038c73c2773e6ec

commit r17-2433-gcd78ae1d1665b7e7c6cc46996038c73c2773e6ec
Author: James K. Lowden <[email protected]>
Date:   Wed Jul 15 18:32:01 2026 -0400

    cobol: Accept TYPEDEF in Local-Storage.
    
    Parser erroneously passed TYPEDEF name to codegen as if a data-item.
    Fixes PR 126281.
    
    gcc/cobol/ChangeLog:
    
            * parse_ante.h (procedure_division_ready): Test field with 
is_typedef().

Diff:
---
 gcc/cobol/parse_ante.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/cobol/parse_ante.h b/gcc/cobol/parse_ante.h
index dbab65f42a4d..492acb677dc2 100644
--- a/gcc/cobol/parse_ante.h
+++ b/gcc/cobol/parse_ante.h
@@ -3724,7 +3724,9 @@ procedure_division_ready( const cbl_loc_t& loc, 
cbl_field_t *returning, ffi_args
                    if( elem.type == SymField ) {
                      auto f = cbl_field_of(&elem);
                      if( f->has_attr(local_e) ) {
-                       parser_local_add(f);
+                       if( ! f->is_typedef() ) {
+                         parser_local_add(f);
+                       }
                      }
                    }
                  } );

Reply via email to