This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/83548] [6/7/8 Regression] Compilation Error using logical function in parameter
- From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 Dec 2017 18:16:07 +0000
- Subject: [Bug fortran/83548] [6/7/8 Regression] Compilation Error using logical function in parameter
- Auto-submitted: auto-generated
- References: <bug-83548-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83548
--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Fri, Dec 22, 2017 at 06:07:47PM +0000, kargl at gcc dot gnu.org wrote:
>
> This is caused by the patch that allowed a type-spec
> in an array constructor. There is special-case code in
> match.c(gfc_match_type_spec) lines 2112-2207 that
> checks for something like
>
> x(4) = [real :: 1., 2. ]
>
> versus
>
> x(4) = [real(1), real(2)]
>
> It seems that the person who wrote that code overlooked
> that there is a conflict between logical, the type, and
> logical, the intrinsic procedure.
>
The obvious work around is
program testit
integer, parameter :: n = 2
logical(kind=1), parameter :: a(n) = [ .true._1, .false._1 ]
do k=1,n
write(6,*) ' a = ', k, a(k)
end do
end program testit