From patchwork Tue Nov 3 18:07:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Dominique_d=27Humi=C3=A8res?= X-Patchwork-Id: 539569 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0975D1413BB for ; Wed, 4 Nov 2015 05:07:59 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=nKH7yk74; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; q=dns; s=default; b=mtn93ovhWwy245SI3sBCjYz lgsUdh4hxb9xnirA/OgJeNPGxN/r7eSz4iVQaNF/p9Y9mW4BEqFtq2H0Ik0ReGHR /IFOjSgG0Z/74HQWeUAO6ftEIl/2ZqPNOnhoa030wmECWFeJN7G+AAEk0/X6Xu5e ClclZB65TPNbv8KVoORg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; s=default; bh=Y4dIGcTTyg8GSJtwfoHlHgObZLk=; b= nKH7yk74UhZy8LotiOz8YpzRKmQ/i3zRYY+KHU/OGQolTCSUK3Az/I7UOV38ekxM pQXh4FI2EMWVTvo2NnsurBiwqHkC7wRALXzN/hGjNGC9znywn7LKUDld3kkykozi WGl5PWuzKxffxio+S/MomljP8VO0Nkvwft7IyM3RQxs= Received: (qmail 32421 invoked by alias); 3 Nov 2015 18:07:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 32404 invoked by uid 89); 3 Nov 2015 18:07:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: nef2.ens.fr Received: from nef2.ens.fr (HELO nef2.ens.fr) (129.199.96.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Nov 2015 18:07:44 +0000 Received: from mailhost.lps.ens.fr (tournesol.lps.ens.fr [129.199.120.1]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id tA3I7fTs063722 ; Tue, 3 Nov 2015 19:07:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mailhost.lps.ens.fr (Postfix) with ESMTP id C116F155; Tue, 3 Nov 2015 19:07:41 +0100 (CET) Received: from mailhost.lps.ens.fr ([127.0.0.1]) by localhost (tournesol.lps.ens.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y1ts1SG9Y0CW; Tue, 3 Nov 2015 19:07:41 +0100 (CET) Received: from [192.168.1.14] (log78-1-82-242-47-10.fbx.proxad.net [82.242.47.10]) by mailhost.lps.ens.fr (Postfix) with ESMTPSA id 93667153; Tue, 3 Nov 2015 19:07:41 +0100 (CET) From: =?utf-8?Q?Dominique_d=27Humi=C3=A8res?= Subject: [PATCH,committed] PR fortran/67982 -- add testcase Date: Tue, 3 Nov 2015 19:07:40 +0100 Message-Id: <4E48AC97-60BC-454C-BF00-20F0FA97CEE6@lps.ens.fr> Cc: gcc-patches To: gfortran Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) 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 + +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