diff options
author | Harald Anlauf <anlauf@gmx.de> | 2021-11-17 22:21:24 +0100 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2021-11-18 19:35:43 +0100 |
commit | 3535be6c6f440909798d1c78e862a657f7adaf63 (patch) | |
tree | 8d841eccce5e8db619325ae471c1f20bf0b3a5f6 /gcc/fortran/check.c | |
parent | 22c242342e38ebffa6bbf7e86e7a1e4abdf0d686 (diff) | |
download | gcc-3535be6c6f440909798d1c78e862a657f7adaf63.zip gcc-3535be6c6f440909798d1c78e862a657f7adaf63.tar.gz gcc-3535be6c6f440909798d1c78e862a657f7adaf63.tar.bz2 |
Fortran: NULL() is not interoperable
gcc/fortran/ChangeLog:
PR fortran/101329
* check.c (is_c_interoperable): Reject NULL() as it is not
interoperable.
gcc/testsuite/ChangeLog:
PR fortran/101329
* gfortran.dg/pr101329.f90: New test.
Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r-- | gcc/fortran/check.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index ffa07b5..5a5aca1 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -5223,6 +5223,12 @@ is_c_interoperable (gfc_expr *expr, const char **msg, bool c_loc, bool c_f_ptr) { *msg = NULL; + if (expr->expr_type == EXPR_NULL) + { + *msg = "NULL() is not interoperable"; + return false; + } + if (expr->ts.type == BT_CLASS) { *msg = "Expression is polymorphic"; |