From e8b31b60f26e3fa4370183b8fdafeae1cb496cb0 Mon Sep 17 00:00:00 2001
From: Bob Dubner <rdubner@symas.com>
Date: Mon, 15 Apr 2024 20:20:41 -0400
Subject: [PATCH] A couple of -main samples fail

---
 gcc/cobol/genapi.cc    | 9 +++++++++
 gcc/cobol/show_parse.h | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc
index 9482a7b6b278..9705498e8b39 100644
--- a/gcc/cobol/genapi.cc
+++ b/gcc/cobol/genapi.cc
@@ -1022,6 +1022,10 @@ static void
 initialize_variable_internal(cbl_refer_t refer, bool explicitly=false)
   {
   cbl_field_t *parsed_var = refer.field;
+  if( parsed_var->type == FldLiteralA )
+    {
+    return;
+    }
 
   if( parsed_var->is_key_name() )
     {
@@ -14698,6 +14702,11 @@ parser_local_add(struct cbl_field_t *new_var )
 void
 parser_symbol_add(struct cbl_field_t *new_var )
   {
+  if( new_var->type == FldLiteralA )
+    {
+    return;
+    }
+
   if( new_var->var_decl_node )
     {
     if( new_var->type != FldConditional )
diff --git a/gcc/cobol/show_parse.h b/gcc/cobol/show_parse.h
index e31aca20d742..a5890438b800 100644
--- a/gcc/cobol/show_parse.h
+++ b/gcc/cobol/show_parse.h
@@ -388,7 +388,7 @@ extern bool cursor_at_sol;
             warnx("%s(): parameter " #a " is NULL", __func__); \
             gcc_assert(false);  \
             }                   \
-        if( !a->var_decl_node && a->type != FldConditional )  \
+        if( !a->var_decl_node && a->type != FldConditional && a->type != FldLiteralA)  \
             {                   \
             warnx("%s() parameter " #a " is variable %s<%s> with NULL var_decl_node", \
                 __func__,       \
-- 
GitLab