From patchwork Thu Jan 6 21:50:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Franke X-Patchwork-Id: 77807 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]) by ozlabs.org (Postfix) with SMTP id 1A033B7137 for ; Fri, 7 Jan 2011 08:49:10 +1100 (EST) Received: (qmail 23285 invoked by alias); 6 Jan 2011 21:49:07 -0000 Received: (qmail 23269 invoked by uid 22791); 6 Jan 2011 21:49:06 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-fx0-f47.google.com (HELO mail-fx0-f47.google.com) (209.85.161.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Jan 2011 21:49:01 +0000 Received: by fxm17 with SMTP id 17so15717296fxm.20 for ; Thu, 06 Jan 2011 13:48:59 -0800 (PST) Received: by 10.223.86.3 with SMTP id q3mr641295fal.139.1294350538749; Thu, 06 Jan 2011 13:48:58 -0800 (PST) Received: from silence.localnet (d001099.adsl.hansenet.de [80.171.1.99]) by mx.google.com with ESMTPS id l3sm3969903fan.2.2011.01.06.13.48.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 Jan 2011 13:48:57 -0800 (PST) From: Daniel Franke To: "H.J. Lu" Subject: Re: [patch, fortran] mixed functions/subroutines in generic interface Date: Thu, 6 Jan 2011 22:50:28 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.35-23-generic-pae; KDE/4.5.1; i686; ; ) Cc: Tobias Burnus , fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org References: <201012290328.05609.franke.daniel@gmail.com> <201101061711.27582.franke.daniel@gmail.com> In-Reply-To: MIME-Version: 1.0 Message-Id: <201101062250.29594.franke.daniel@gmail.com> X-IsSubscribed: yes 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 On Thursday 06 January 2011 20:31:08 H.J. Lu wrote: > > Fixed whitespaces and committed as r168542. > > This caused: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47195 Committed attached changes as obvious as r168554. No idea how I managed to mess this up :( Daniel Index: gfortran.dg/interface_33.f90 =================================================================== --- gfortran.dg/interface_33.f90 (revision 168553) +++ gfortran.dg/interface_33.f90 (revision 168554) @@ -1,4 +1,4 @@ -! { dg-do "compile" } +! { dg-do compile } ! ! PR fortran/33117, PR fortran/46478 ! Procedures of a generic interface must be either @@ -10,7 +10,7 @@ ! module m1 interface gen - subroutine sub() ! dg-error { "all SUBROUTINEs or all FUNCTIONs" } + subroutine sub() ! { dg-error "all SUBROUTINEs or all FUNCTIONs" } end subroutine sub function bar() real :: bar @@ -27,7 +27,7 @@ MODULE m2 MODULE PROCEDURE subr_name END INTERFACE CONTAINS - LOGICAL FUNCTION func_name() ! dg-error { "all SUBROUTINEs or all FUNCTIONs" } + LOGICAL FUNCTION func_name() ! { dg-error "all SUBROUTINEs or all FUNCTIONs" } END FUNCTION SUBROUTINE subr_name() END SUBROUTINE Index: gfortran.dg/defined_operators_1.f90 =================================================================== --- gfortran.dg/defined_operators_1.f90 (revision 168553) +++ gfortran.dg/defined_operators_1.f90 (revision 168554) @@ -17,10 +17,21 @@ module mymod character(*) :: foo_chr character(*), intent(in) :: chr end function foo_chr + end interface + + ! + ! PR fortran/33117 + ! PR fortran/46478 + ! Mixing FUNCTIONs and SUBROUTINEs in an INTERFACE hides the + ! errors that should be tested here. Hence split out subroutine + ! to test separately. + ! + interface operator (.bar.) subroutine bad_foo (chr) ! { dg-error "must be a FUNCTION" } character(*), intent(in) :: chr end subroutine bad_foo end interface + contains function foo_0 () ! { dg-error "must have at least one argument" } integer :: foo_1 Index: ChangeLog =================================================================== --- ChangeLog (revision 168553) +++ ChangeLog (revision 168554) @@ -1,3 +1,11 @@ +2011-01-06 Daniel Franke + + PR fortran/47195 + * gfortran.dg/interface_33.f90: Fixed dg-error declarations. + * gfortran.dg/defined_operators_1.f90: Split the subroutine + from the interface of functions to not hide the errors that + shall be tested. + 2011-01-06 Jan Hubicka * testsuite/gcc.dg/lto/pr47188_0.c: New testcase.