2017-09-12 Paul Thomas <pault@gcc.gnu.org>
commit87a0366f08c2c16473e81635336c487209b708cf
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Sep 2017 18:06:52 +0000 (12 18:06 +0000)
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Sep 2017 18:06:52 +0000 (12 18:06 +0000)
tree35868a7bbccbfde8c2a0a0a67d0e69c9c17b1d6c
parentd0917ddf1e574ade4b1d2d605dd3dbb8a1f62890
2017-09-12  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/82173
PR fortran/82168
* decl.c (variable_decl): Check pdt template components for
appearance of KIND/LEN components in the type parameter name
list, that components corresponding to type parameters have
either KIND or LEN attributes and that KIND or LEN components
are scalar. Copy the initializer to the parameter value.
(gfc_get_pdt_instance): Add a label 'error_return' and follow
it with repeated code, while replacing this code with a jump.
Check if a parameter appears as a component in the template.
Make sure that the parameter expressions are integer. Validate
KIND expressions.
(gfc_match_decl_type_spec): Search for pdt_types in the parent
namespace since they are instantiated in the template ns.
* expr.c (gfc_extract_int): Use a KIND parameter if it
appears as a component expression.
(gfc_check_init_expr): Allow expressions with the pdt_kind
attribute.
*primary.c (gfc_match_actual_arglist): Make sure that the first
keyword argument is recognised when 'pdt' is set.

2017-09-12  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/82173
* gfortran.dg/pdt_4.f03 : Remove the 'is being used before it
is defined' error.
* gfortran.dg/pdt_6.f03 : New test.
* gfortran.dg/pdt_7.f03 : New test.
* gfortran.dg/pdt_8.f03 : New test.

PR fortran/82168
* gfortran.dg/pdt_9.f03 : New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252039 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/expr.c
gcc/fortran/primary.c
gcc/fortran/symbol.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pdt_4.f03
gcc/testsuite/gfortran.dg/pdt_6.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pdt_7.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pdt_8.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pdt_9.f03 [new file with mode: 0644]