public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/42651]  New: Functions with result: Wrongly accepts attributes to function name
@ 2010-01-07 17:22 burnus at gcc dot gnu dot org
  0 siblings, 0 replies; only message in thread
From: burnus at gcc dot gnu dot org @ 2010-01-07 17:22 UTC (permalink / raw)
  To: gcc-bugs

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


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

only message in thread, other threads:[~2010-01-07 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-07 17:22 [Bug fortran/42651] New: Functions with result: Wrongly accepts attributes to function name burnus at gcc dot gnu dot org

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).