When compiling the attached code with gfortran I get: procedure(i_f), pointer, protected :: p_f => null() 1 Error: PROTECTED attribute conflicts with EXTERNAL attribute at (1)
I think that the code is legal, according to the standard C535 (R501) The PROTECTED attribute is permitted only for a procedure pointer or named variable that is not in a common block. gfortran --version GNU Fortran (GCC) 4.6.0 20100520 (experimental) module m implicit none abstract interface pure function i_f(x) result(y) real, intent(in) :: x real :: y end function i_f end interface !procedure(i_f), pointer :: p_f => null() ! this works procedure(i_f), pointer, protected :: p_f => null() end module m -- Summary: Error with protected pocedure pointer Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mrestelli at gmail dot com GCC host triplet: x86_64 AMD Turion(tm) 64 Mobile Technology http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44446