From f7d28818179247685f3c101f9f2f16366f56309b Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Wed, 26 Oct 2022 21:00:44 +0200 Subject: Fortran: BOZ literal constants are not compatible to any type [PR103413] gcc/fortran/ChangeLog: PR fortran/103413 * symbol.cc (gfc_type_compatible): A boz-literal-constant has no type and thus is not considered compatible to any type. gcc/testsuite/ChangeLog: PR fortran/103413 * gfortran.dg/illegal_boz_arg_4.f90: New test. --- gcc/fortran/symbol.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/fortran') diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc index 6050359..49fb378 100644 --- a/gcc/fortran/symbol.cc +++ b/gcc/fortran/symbol.cc @@ -5139,6 +5139,10 @@ gfc_type_compatible (gfc_typespec *ts1, gfc_typespec *ts2) bool is_union1 = (ts1->type == BT_UNION); bool is_union2 = (ts2->type == BT_UNION); + /* A boz-literal-constant has no type. */ + if (ts1->type == BT_BOZ || ts2->type == BT_BOZ) + return false; + if (is_class1 && ts1->u.derived->components && ((ts1->u.derived->attr.is_class -- cgit v1.1 From 486a50374e7c6200c476e67ffbe13ad71ac3262a Mon Sep 17 00:00:00 2001 From: GCC Administrator Date: Thu, 27 Oct 2022 00:18:35 +0000 Subject: Daily bump. --- gcc/fortran/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f764113..1ca82cd 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2022-10-26 Harald Anlauf + + PR fortran/103413 + * symbol.cc (gfc_type_compatible): A boz-literal-constant has no type + and thus is not considered compatible to any type. + 2022-10-21 José Rui Faustino de Sousa PR fortran/100097 -- cgit v1.1