diff options
author | Paul-Antoine Arras <pa@codesourcery.com> | 2023-10-20 12:42:49 +0200 |
---|---|---|
committer | Paul-Antoine Arras <pa@codesourcery.com> | 2023-10-26 15:12:37 +0200 |
commit | 8d2130a4e5ce369f5884c8522934dc027db6e9d8 (patch) | |
tree | 799e2df49d40b047c9275c2f30452476781b039e /gcc/dwarf2out.cc | |
parent | a4ca8691333344cecc595d1af8b21e51f588e2f2 (diff) | |
download | gcc-8d2130a4e5ce369f5884c8522934dc027db6e9d8.zip gcc-8d2130a4e5ce369f5884c8522934dc027db6e9d8.tar.gz gcc-8d2130a4e5ce369f5884c8522934dc027db6e9d8.tar.bz2 |
Fortran: Fix incompatible types between INTEGER(8) and TYPE(c_ptr)
In the context of an OpenMP declare variant directive, arguments of type C_PTR
are sometimes recognised as C_PTR in the base function and as INTEGER(8) in the
variant - or the other way around, depending on the parsing order.
This patch prevents such situation from turning into a compile error.
2023-10-20 Paul-Antoine Arras <pa@codesourcery.com>
Tobias Burnus <tobias@codesourcery.com>
gcc/fortran/ChangeLog:
* interface.cc (gfc_compare_types): Return true if one type is C_PTR
and the other is a compatible INTEGER(8).
* misc.cc (gfc_typename): Handle the case where an INTEGER(8) actually
holds a TYPE(C_PTR).
gcc/testsuite/ChangeLog:
* gfortran.dg/c_ptr_tests_20.f90: New test, checking that INTEGER(8)
and TYPE(C_PTR) are recognised as compatible.
* gfortran.dg/c_ptr_tests_21.f90: New test, exercising the error
detection for C_FUNPTR.
Diffstat (limited to 'gcc/dwarf2out.cc')
0 files changed, 0 insertions, 0 deletions