From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9025 invoked by alias); 7 Jan 2010 17:22:10 -0000 Received: (qmail 9000 invoked by uid 48); 7 Jan 2010 17:21:59 -0000 Date: Thu, 07 Jan 2010 17:22:00 -0000 Subject: [Bug fortran/42651] New: Functions with result: Wrongly accepts attributes to function name X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-01/txt/msg00814.txt.bz2 Using VOLATILE, TARGET etc. for function names is valid, but only if there is no extra RESULT variable. I thought the following would fix it, but it does not seem to work: if (attr->function && !attr->result) { a1 = function; conf2 (allocatable); conf2 (asynchronous); conf2 (dimension); conf2 (pointer); conf2 (target); conf2 (volatile_); } Test case: integer function func() asynchronous :: func integer, asynchronous:: b allocatable :: c volatile :: func type t sequence integer :: i = 5 end type t end function func function func2() result(res) volatile res volatile func2 ! { dg-error "FUNCTION attribute conflicts with VOLATILE" } asynchronous res asynchronous func2 ! { dg-error "FUNCTION attribute conflicts with ASYNCHRONOUS" } allocatable func2 ! { dg-error "FUNCTION attribute conflicts with ALLOCATABLE" } target func2 ! { dg-error "FUNCTION attribute conflicts with TARGET" } dimension func2(2) ! { dg-error "FUNCTION attribute conflicts with DIMENSION" } end function func2 -- Summary: Functions with result: Wrongly accepts attributes to function name Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42651