Fortran: Fix bind(C) character length checks
authorTobias Burnus <tobias@codesourcery.com>
Wed, 21 Jul 2021 07:36:48 +0000 (09:36 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 21 Jul 2021 07:36:48 +0000 (09:36 +0200)
commitb3d4011ba10275fbd5d6ec5a16d5aaebbdfb5d3c
tree2375d0a9b7f7eae0d79a2f95934f1a0edfb83b75
parent957952ce64e067c56e58df5ee36bbb004eecffa1
Fortran: Fix bind(C) character length checks

gcc/fortran/ChangeLog:

* decl.c (gfc_verify_c_interop_param): Update for F2008 + F2018
changes; reject unsupported bits with 'Error: Sorry,'.
* trans-expr.c (gfc_conv_procedure_call): Fix condition to
For using CFI descriptor with characters.

gcc/testsuite/ChangeLog:

* gfortran.dg/iso_c_binding_char_1.f90: Update dg-error.
* gfortran.dg/pr32599.f03: Use -std=-f2003 + update comment.
* gfortran.dg/bind_c_char_10.f90: New test.
* gfortran.dg/bind_c_char_6.f90: New test.
* gfortran.dg/bind_c_char_7.f90: New test.
* gfortran.dg/bind_c_char_8.f90: New test.
* gfortran.dg/bind_c_char_9.f90: New test.
gcc/fortran/decl.c
gcc/fortran/trans-expr.c
gcc/testsuite/gfortran.dg/bind_c_char_10.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/bind_c_char_6.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/bind_c_char_7.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/bind_c_char_8.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/bind_c_char_9.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/iso_c_binding_char_1.f90
gcc/testsuite/gfortran.dg/pr32599.f03