From 63a496dedb96263534f3eb152d66d59e8f08b125 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Sat, 4 Oct 2014 10:18:07 +0000 Subject: [PATCH] re PR fortran/36534 (Bogus: '__convert_s1_s4' at (1) is obsolescent in fortran 95) PR fortran/36534 * resolve.c (resolve_fl_procedure): Clean up obsolescence warning. * gfortran.dg/widechar_10.f90: New test. From-SVN: r215887 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/resolve.c | 10 +++++----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/widechar_10.f90 | 6 ++++++ 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/widechar_10.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8a781ad46b0..03b3b66a8dd 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2014-10-04 Francois-Xavier Coudert + + PR fortran/36534 + * resolve.c (resolve_fl_procedure): Clean up obsolescence warning. + 2014-09-25 Tobias Burnus * check.c (check_co_collective): Renamed from check_co_minmaxsum, diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 4b8f3b12a95..30ee175d2ac 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -11266,11 +11266,11 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) } /* Appendix B.2 of the standard. Contained functions give an - error anyway. Fixed-form is likely to be F77/legacy. Deferred - character length is an F2003 feature. */ - if (!sym->attr.contained - && gfc_current_form != FORM_FIXED - && !sym->ts.deferred) + error anyway. Deferred character length is an F2003 feature. + Don't warn on intrinsic conversion functions, which start + with two underscores. */ + if (!sym->attr.contained && !sym->ts.deferred + && (sym->name[0] != '_' || sym->name[1] != '_')) gfc_notify_std (GFC_STD_F95_OBS, "CHARACTER(*) function '%s' at %L", sym->name, &sym->declared_at); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2293926ea89..9db549ee6d3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-10-04 Francois-Xavier Coudert + + PR fortran/36534 + * gfortran.dg/widechar_10.f90: New test. + 2014-10-03 Jan Hubicka * testsuite/g++.dg/ipa/devirt-42.C: New testcase. diff --git a/gcc/testsuite/gfortran.dg/widechar_10.f90 b/gcc/testsuite/gfortran.dg/widechar_10.f90 new file mode 100644 index 00000000000..19f0ab33edb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/widechar_10.f90 @@ -0,0 +1,6 @@ +! { dg-do compile } +! { dg-options "-pedantic" } +! PR fortran/36534 +CHARACTER (kind=4,len=*) MY_STRING4(1:3) +PARAMETER ( MY_STRING4 = (/ "A" , "B", "C" /) ) +end -- 2.30.2