https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77296
Bug ID: 77296 Summary: Compiler Error with allocatable string and associate Product: gcc Version: 6.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: matthew.thompson at nasa dot gov Target Milestone: --- This program: program test implicit none character(len=:), allocatable :: s s = 'a' associate(ss => s) print*,ss end associate end program test causes a bogus compiler error with gfortran 6.1.0: (350) $ gfortran -v -save-temps test.F90 Driving: gfortran -v -save-temps test.F90 -l gfortran -l m -shared-libgcc Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/ford1/local/gcc/gcc-6.1.0-rhel6/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-6.1.0/configure --prefix=/ford1/local/gcc/gcc-6.1.0-rhel6 --disable-multilib Thread model: posix gcc version 6.1.0 (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /ford1/local/gcc/gcc-6.1.0-rhel6/libexec/gcc/x86_64-pc-linux-gnu/6.1.0/f951 test.F90 -cpp=test.f90 -quiet -v test.F90 -quiet -dumpbase test.F90 -mtune=generic -march=x86-64 -auxbase test -version -fintrinsic-modules-path /ford1/local/gcc/gcc-6.1.0-rhel6/lib/gcc/x86_64-pc-linux-gnu/6.1.0/finclude -o test.s GNU Fortran (GCC) version 6.1.0 (x86_64-pc-linux-gnu) compiled by GNU C version 6.1.0, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1, isl version 0.15 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/ford1/local/gcc/gcc-6.1.0-rhel6/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../x86_64-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /ford1/local/gcc/gcc-6.1.0-rhel6/lib/gcc/x86_64-pc-linux-gnu/6.1.0/finclude /ford1/local/gcc/gcc-6.1.0-rhel6/lib/gcc/x86_64-pc-linux-gnu/6.1.0/include /usr/local/include /ford1/local/gcc/gcc-6.1.0-rhel6/include /ford1/local/gcc/gcc-6.1.0-rhel6/lib/gcc/x86_64-pc-linux-gnu/6.1.0/include-fixed /usr/include End of search list. GNU Fortran2008 (GCC) version 6.1.0 (x86_64-pc-linux-gnu) compiled by GNU C version 6.1.0, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1, isl version 0.15 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 test.F90:7:20: associate(ss => s) 1 Error: Entity ‘ss’ at (1) has a deferred type parameter and requires either the pointer or allocatable attribute