* [Bug fortran/52325] unclear error: Unclassifiable statement
2012-02-21 10:39 [Bug fortran/52325] New: unclear error: Unclassifiable statement kloedej at knmi dot nl
@ 2012-02-21 11:09 ` burnus at gcc dot gnu.org
2012-02-21 16:43 ` burnus at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-21 11:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52325
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
CC| |burnus at gcc dot gnu.org
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-21 11:05:11 UTC ---
Untested patch:
--- primary.c (revision 184431)
+++ primary.c (working copy)
@@ -1910,6 +1910,19 @@ gfc_match_varspec (gfc_expr *primary, int equiv_fl
&& gfc_get_default_type (sym->name, sym->ns)->type == BT_DERIVED)
gfc_set_default_type (sym, 0, sym->ns);
+ if (sym->ts.type == BT_UNKNOWN && gfc_match_char ('%') == MATCH_YES)
+ {
+ gfc_error ("Symbol %s at %C has no IMPLICIT type", sym->name);
+ return MATCH_ERROR;
+ }
+ else if ((sym->ts.type != BT_DERIVED && sym->ts.type != BT_CLASS)
+ && gfc_match_char ('%') == MATCH_YES)
+ {
+ gfc_error ("Unexpected %% for nonderived type variable %s at %C",
+ sym->name);
+ return MATCH_ERROR;
+ }
+
if ((sym->ts.type != BT_DERIVED && sym->ts.type != BT_CLASS)
|| gfc_match_char ('%') != MATCH_YES)
goto check_substring;
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/52325] unclear error: Unclassifiable statement
2012-02-21 10:39 [Bug fortran/52325] New: unclear error: Unclassifiable statement kloedej at knmi dot nl
2012-02-21 11:09 ` [Bug fortran/52325] " burnus at gcc dot gnu.org
@ 2012-02-21 16:43 ` burnus at gcc dot gnu.org
2012-02-22 6:52 ` Joost.VandeVondele at mat dot ethz.ch
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-21 16:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52325
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-21 15:58:23 UTC ---
Submitted patch (pending review):
http://gcc.gnu.org/ml/fortran/2012-02/msg00089.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/52325] unclear error: Unclassifiable statement
2012-02-21 10:39 [Bug fortran/52325] New: unclear error: Unclassifiable statement kloedej at knmi dot nl
2012-02-21 11:09 ` [Bug fortran/52325] " burnus at gcc dot gnu.org
2012-02-21 16:43 ` burnus at gcc dot gnu.org
@ 2012-02-22 6:52 ` Joost.VandeVondele at mat dot ethz.ch
2012-02-22 7:05 ` Joost.VandeVondele at mat dot ethz.ch
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2012-02-22 6:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52325
--- Comment #3 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2012-02-22 06:49:41 UTC ---
(In reply to comment #2)
> Submitted patch (pending review):
> http://gcc.gnu.org/ml/fortran/2012-02/msg00089.html
OK ;-)
this would be a significant improvement.
I think it is independent, but a better choice for the error message could be
'Symbol %s at %C has an undefined type'. The type could be implicitly or
explicitly defined, that doesn't matter so much. For consistency, I believe
your proposed message is fine.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/52325] unclear error: Unclassifiable statement
2012-02-21 10:39 [Bug fortran/52325] New: unclear error: Unclassifiable statement kloedej at knmi dot nl
` (2 preceding siblings ...)
2012-02-22 6:52 ` Joost.VandeVondele at mat dot ethz.ch
@ 2012-02-22 7:05 ` Joost.VandeVondele at mat dot ethz.ch
2012-03-02 13:21 ` burnus at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2012-02-22 7:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52325
--- Comment #4 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2012-02-22 06:53:09 UTC ---
(In reply to comment #2)
> Submitted patch (pending review):
> http://gcc.gnu.org/ml/fortran/2012-02/msg00089.html
and a nitpick... it should be 'non-derived type' instead on 'nonderived type'
(unless I got this with the hyphens wrong again).
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/52325] unclear error: Unclassifiable statement
2012-02-21 10:39 [Bug fortran/52325] New: unclear error: Unclassifiable statement kloedej at knmi dot nl
` (3 preceding siblings ...)
2012-02-22 7:05 ` Joost.VandeVondele at mat dot ethz.ch
@ 2012-03-02 13:21 ` burnus at gcc dot gnu.org
2012-03-02 13:37 ` burnus at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-03-02 13:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52325
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-03-02 13:21:00 UTC ---
Author: burnus
Date: Fri Mar 2 13:20:52 2012
New Revision: 184785
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184785
Log:
2012-03-02 Tobias Burnus <burnus@net-b.de>
PR fortran/52325
* primary.c (gfc_match_varspec): Add diagnostic for % with
nonderived types.
2012-03-02 Tobias Burnus <burnus@net-b.de>
PR fortran/52325
* gfortran.dg/derived_comp_array_ref_8.f90: New.
* gfortran.dg/nullify_2.f90: Update dg-error.
* gfortran.dg/nullify_4.f90: Ditto.
* gfortran.dg/pointer_init_6.f90: Ditto.
Added:
trunk/gcc/testsuite/gfortran.dg/derived_comp_array_ref_8.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/primary.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/nullify_2.f90
trunk/gcc/testsuite/gfortran.dg/nullify_4.f90
trunk/gcc/testsuite/gfortran.dg/pointer_init_6.f90
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/52325] unclear error: Unclassifiable statement
2012-02-21 10:39 [Bug fortran/52325] New: unclear error: Unclassifiable statement kloedej at knmi dot nl
` (4 preceding siblings ...)
2012-03-02 13:21 ` burnus at gcc dot gnu.org
@ 2012-03-02 13:37 ` burnus at gcc dot gnu.org
2012-03-02 13:51 ` kloedej at knmi dot nl
2012-03-02 15:01 ` burnus at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-03-02 13:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52325
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-03-02 13:36:35 UTC ---
FIXED on the trunk (i.e. GCC 4.8).
It had bothered me already a couple of times - your PR report finally nudged me
to fix it.
Thanks for the bug report.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/52325] unclear error: Unclassifiable statement
2012-02-21 10:39 [Bug fortran/52325] New: unclear error: Unclassifiable statement kloedej at knmi dot nl
` (5 preceding siblings ...)
2012-03-02 13:37 ` burnus at gcc dot gnu.org
@ 2012-03-02 13:51 ` kloedej at knmi dot nl
2012-03-02 15:01 ` burnus at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: kloedej at knmi dot nl @ 2012-03-02 13:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52325
--- Comment #7 from Jos de Kloe <kloedej at knmi dot nl> 2012-03-02 13:50:59 UTC ---
Thanks for your (really) fast response and fix.
I'll keep my eye open for other details that might improve gfortran.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/52325] unclear error: Unclassifiable statement
2012-02-21 10:39 [Bug fortran/52325] New: unclear error: Unclassifiable statement kloedej at knmi dot nl
` (6 preceding siblings ...)
2012-03-02 13:51 ` kloedej at knmi dot nl
@ 2012-03-02 15:01 ` burnus at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-03-02 15:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52325
--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-03-02 14:59:05 UTC ---
Author: burnus
Date: Fri Mar 2 14:58:58 2012
New Revision: 184790
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184790
Log:
2012-03-02 Tobias Burnus <burnus@net-b.de>
PR fortran/52325
* primary.c (gfc_match_varspec): Add missing ;.
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/primary.c
^ permalink raw reply [flat|nested] 9+ messages in thread