This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37504] Wrongly rejects: unprotected_pointer => protected_pointer
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Sep 2008 14:48:48 -0000
- Subject: [Bug fortran/37504] Wrongly rejects: unprotected_pointer => protected_pointer
- References: <bug-37504-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2008-09-13 14:48 -------
First patch - completely untested/uncompiled:
Index: expr.c
===================================================================
--- expr.c (Revision 140340)
+++ expr.c
@@ -3053 +3053,2 @@ gfc_check_pointer_assign (gfc_expr *lval
- if (attr.is_protected && attr.use_assoc)
+ if (attr.is_protected && attr.use_assoc
+ && !(attr.pointer || attr.proc_pointer))
I don't quite understand why one gets "Error: PROTECTED at (1) only allowed in
specification part of a module" for the following example.
module m
implicit none
integer, pointer, protected :: protected_pointer
integer, target, protected :: protected_target
end module m
program p
use m
implicit none
integer, pointer :: unprotected_pointer
unprotected_pointer => protected_target ! OK, is rejected
unprotected_pointer => protected_pointer ! WRONG, is wrongly REJECTED
protected_pointer => unprotected_pointer ! OK, is rejected, BUT MATCH ERROR
end program p
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37504