diff options
author | Tobias Burnus <burnus@net-b.de> | 2010-06-08 08:37:32 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-06-08 08:37:32 +0200 |
commit | c064bf1cefe997074dcc4fec96317a63335634af (patch) | |
tree | faee54b2196b28339a9768a43ed57cbe759b5fb1 /gcc/fortran/resolve.c | |
parent | af88c58fb826aad723367d1b1ac09b6b64c87c68 (diff) | |
download | gcc-c064bf1cefe997074dcc4fec96317a63335634af.zip gcc-c064bf1cefe997074dcc4fec96317a63335634af.tar.gz gcc-c064bf1cefe997074dcc4fec96317a63335634af.tar.bz2 |
re PR fortran/44446 (Error with protected pocedure pointer)
2010-06-07 Tobias Burnus <burnus@net-b.de>
PR fortran/44446
* symbol.c (check_conflict): Move protected--external/procedure
check ...
* resolve.c (resolve_select_type): ... to the resolution stage.
2010-06-07 Tobias Burnus <burnus@net-b.de>
PR fortran/44446
* gfortran.dg/proc_ptr_27.f90: New.
From-SVN: r160424
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 7e5a4f9..e4c7394 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -11311,6 +11311,19 @@ resolve_symbol (gfc_symbol *sym) } } + if (sym->attr.is_protected && !sym->attr.proc_pointer + && (sym->attr.procedure || sym->attr.external)) + { + if (sym->attr.external) + gfc_error ("PROTECTED attribute conflicts with EXTERNAL attribute " + "at %L", &sym->declared_at); + else + gfc_error ("PROCEDURE attribute conflicts with PROTECTED attribute " + "at %L", &sym->declared_at); + + return; + } + if (sym->attr.flavor == FL_DERIVED && resolve_fl_derived (sym) == FAILURE) return; |