Commit 2cf5f485 authored by Harald Anlauf's avatar Harald Anlauf
Browse files

Fortran: fix bounds check for copying of class expressions [PR106945]

In the bounds check for copying of class expressions, the number of elements
determined from a descriptor, returned as type gfc_array_index_type (i.e. a
signed type), should be converted to the type of the passed element count,
which is of type size_type_node (i.e. unsigned), for use in comparisons.

gcc/fortran/ChangeLog:

	PR fortran/106945
	* trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
	bounds check to common type for comparison.

gcc/testsuite/ChangeLog:

	PR fortran/106945
	* gfortran.dg/pr106945.f90: New test.
parent c62df15d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment