Hello world,

I just committed the fix for PR 11845 as obvious and simple, as
r15-7552-gfd00010ba21c04bddb20aef52f62de5636075067 .

Fix PR 118884, Lapack build failure.

The fix for PR 118845 introduced new checks, which in turn exposed
a case where the typespec information on a symbol generated symbol
was not set.  This led to an apparent type of BT_UNKNOWN, and hence
an error.  Fixed as obvious and simple, after regression-testing.

Best regards

        Thomas

gcc/fortran/ChangeLog:

        * frontend-passes.cc (check_externals_procedure): Copy
        typespec from old to new symbol.

gcc/testsuite/ChangeLog:

        * gfortran.dg/interface_54.f90: New test.
diff --git a/gcc/fortran/frontend-passes.cc b/gcc/fortran/frontend-passes.cc
index 6b470b83e21..20bf6e127ff 100644
--- a/gcc/fortran/frontend-passes.cc
+++ b/gcc/fortran/frontend-passes.cc
@@ -5727,6 +5727,7 @@ check_externals_procedure (gfc_symbol *sym, locus *loc,
   gcc_assert (new_sym);
   new_sym->attr = sym->attr;
   new_sym->attr.if_source = IFSRC_DECL;
+  new_sym->ts = sym->ts;
   gfc_current_ns = gsym->ns;
 
   gfc_get_formal_from_actual_arglist (new_sym, actual);
diff --git a/gcc/testsuite/gfortran.dg/interface_54.f90 b/gcc/testsuite/gfortran.dg/interface_54.f90
new file mode 100644
index 00000000000..98318cae888
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_54.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! PR 118884 - this used to be rejected due to confused interface
+! checking.
+
+subroutine cget24
+  external cslect
+  logical cslect
+
+  call cgeesx(cslect)
+  if( cslect() ) print *,"foo"
+  call cgeesx(cslect)
+end subroutine cget24

Reply via email to