Blob Blame History Raw
From ced1b6638459f33dc9f22a0cd959f97c05a62e22 Mon Sep 17 00:00:00 2001
From: Jim MacArthur <jim.macarthur@codethink.co.uk>
Date: Wed, 7 Oct 2015 18:23:31 -0400
Subject: [PATCH 11/23] Allow character-to-int conversions in DATA statements

This feature is enabled by the `-std=extra-legacy` compiler flag.
---

    0011-Allow-character-to-int-conversions-in-DATA-statement.patch

diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index f347c75..9982b8d 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3294,6 +3294,10 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform,
 	  || rvalue->ts.type == BT_HOLLERITH)
 	return true;
 
+      if ((gfc_option.allow_std & GFC_STD_EXTRA_LEGACY)
+	  && gfc_numeric_ts (&lvalue->ts) && rvalue->ts.type == BT_CHARACTER)
+	return true;
+
       if (lvalue->ts.type == BT_LOGICAL && rvalue->ts.type == BT_LOGICAL)
 	return true;