aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2022-10-26 21:00:44 +0200
committerHarald Anlauf <anlauf@gmx.de>2022-10-26 22:23:44 +0200
commitf7d28818179247685f3c101f9f2f16366f56309b (patch)
tree97dbc2c8b0f9997bfc02643852f771e22f59f594 /gcc/fortran
parent068baae1864e2a8036beec3082d384a204e24201 (diff)
downloadgcc-f7d28818179247685f3c101f9f2f16366f56309b.zip
gcc-f7d28818179247685f3c101f9f2f16366f56309b.tar.gz
gcc-f7d28818179247685f3c101f9f2f16366f56309b.tar.bz2
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.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/symbol.cc4
1 files changed, 4 insertions, 0 deletions
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