public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH,committed] PR fortran/67982 -- add testcase
@ 2015-11-03 18:07 Dominique d'Humières
  0 siblings, 0 replies; only message in thread
From: Dominique d'Humières @ 2015-11-03 18:07 UTC (permalink / raw)
  To: gfortran; +Cc: gcc-patches

I've committed a testcase for PR fortran/67982 to trunk.
Dominique
Index: gcc/testsuite/gfortran.dg/warn_unused_function_3.f90
===================================================================
--- gcc/testsuite/gfortran.dg/warn_unused_function_3.f90	(nonexistent)
+++ gcc/testsuite/gfortran.dg/warn_unused_function_3.f90	(working copy)
@@ -0,0 +1,35 @@
+! { dg-do compile }
+! { dg-options "-Wunused-function" }
+!
+! PR 67982: Bogus -Wunused-function warning with contained function
+!
+! Contributed by Joost VandeVondele <Joost dot VandeVondele at mat dot ethz dot ch> 
+
+MODULE base
+  INTERFACE 
+    SUBROUTINE bar_int()
+    END SUBROUTINE 
+  END INTERFACE
+  PUBLIC hook
+  PRIVATE 
+  PROCEDURE(bar_int), POINTER :: hook=>NULL()
+END MODULE base
+
+MODULE foo
+  USE base, ONLY: hook  
+  PUBLIC init
+  PRIVATE 
+CONTAINS
+  SUBROUTINE init()
+     hook=>bar
+  END SUBROUTINE init
+  SUBROUTINE bar()
+     WRITE(6,*) "In bar"
+  END SUBROUTINE 
+END MODULE
+
+USE foo, ONLY: init
+USE base, ONLY: hook
+CALL init()
+CALL hook()
+END

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-03 18:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-03 18:07 [PATCH,committed] PR fortran/67982 -- add testcase Dominique d'Humières

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).