https://gcc.gnu.org/g:13a8d18fdbb15ed4669e59f50b0af7b67832cb18

commit r17-4584-g13a8d18fdbb15ed4669e59f50b0af7b67832cb18
Author: James K. Lowden <[email protected]>
Date:   Thu Sep 17 12:15:47 2026 -0400

    cobol: Recognize figurative constants for implicit PICTURE.
    
    gcc/cobol/ChangeLog:
    
            * parse_ante.h (update_prior_invalid_field): Use is_figconst.
            (field_add): Always call update_prior_invalid_field.

Diff:
---
 gcc/cobol/parse_ante.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/cobol/parse_ante.h b/gcc/cobol/parse_ante.h
index df48210d6b60..2dbf02eac632 100644
--- a/gcc/cobol/parse_ante.h
+++ b/gcc/cobol/parse_ante.h
@@ -3333,7 +3333,7 @@ update_prior_invalid_field( const cbl_field_t *field = 
nullptr) {
     if( ! field ) field = f; // fake it
     if( field->level <= f->level ) {
       if( f->type == FldInvalid && f->data.has_initial_value() ) {
-        if( f->has_attr(quoted_e) ) {
+        if( f->has_attr(quoted_e) || is_figconst(f) ) {
           f->type = FldAlphanumeric;
           assert(0 < f->char_capacity());
         }
@@ -3376,9 +3376,10 @@ field_add( const cbl_loc_t& loc, cbl_field_t *field ) {
       return NULL;
       break;
     }
-  } else {
-    update_prior_invalid_field(field);
-  }
+  } 
+
+  update_prior_invalid_field(field);
+
   return field;
 }

Reply via email to