Bug 82173 (PDT)

Summary: [meta-bug] [PDT] Parameterized derived type errors
Product: gcc Reporter: Thomas Koenig <tkoenig>
Component: fortranAssignee: Paul Thomas <pault>
Status: ASSIGNED ---    
Severity: normal CC: kargls, neil.n.carlson, pault
Priority: P3    
Version: 8.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2017-09-11 00:00:00
Bug Depends on: 82205, 82649, 82753, 82842, 82843, 83274, 83275, 83646, 83746, 83762, 83763, 84008, 84119, 84122, 84143, 84432, 85942, 86052, 86657, 87669, 87908, 89707, 89751, 90218, 91022, 93175, 95504, 95541, 95543, 99709, 102240, 102241, 102457, 102686, 102901, 103371, 103414, 103508, 103748, 104096, 104097, 104650, 105380, 106242, 107142, 108663, 112460, 82168, 82375, 82497, 82586, 82587, 82589, 82605, 82606, 82620, 82622, 82719, 82720, 82865, 82866, 82943, 82978, 82979, 83567, 83611, 83731, 84120, 86148, 86268, 89413, 89601, 102003    
Bug Blocks: 20585    

Description Thomas Koenig 2017-09-11 08:39:26 UTC
A PDT meta-bug to make them easier to find.
Comment 1 Paul Thomas 2017-09-11 15:22:52 UTC
Dear Thomas,

Thanks for doing that.

Cheers

Paul
Comment 2 Paul Thomas 2017-09-12 18:07:24 UTC
Author: pault
Date: Tue Sep 12 18:06:52 2017
New Revision: 252039

URL: https://gcc.gnu.org/viewcvs?rev=252039&root=gcc&view=rev
Log:
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.

Added:
    trunk/gcc/testsuite/gfortran.dg/pdt_6.f03
    trunk/gcc/testsuite/gfortran.dg/pdt_7.f03
    trunk/gcc/testsuite/gfortran.dg/pdt_8.f03
    trunk/gcc/testsuite/gfortran.dg/pdt_9.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/symbol.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/pdt_4.f03
Comment 3 Paul Thomas 2017-09-13 21:15:58 UTC
Author: pault
Date: Wed Sep 13 21:15:26 2017
New Revision: 252734

URL: https://gcc.gnu.org/viewcvs?rev=252734&root=gcc&view=rev
Log:
2017-09-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82173
	* decl.c (match_char_kind): If the kind expression is
	parameterized, save it in saved_kind_expr and set kind = 0.
	(gfc_get_pdt_instance): Resolve and simplify before emitting
	error on expression kind. Insert a missing simplification after
	insertion of kind expressions.

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

	PR fortran/82173
	* gfortran.dg/pdt_10.f03 : New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/pdt_10.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/testsuite/ChangeLog
Comment 4 Paul Thomas 2017-09-17 18:25:08 UTC
Author: pault
Date: Sun Sep 17 18:24:37 2017
New Revision: 252894

URL: https://gcc.gnu.org/viewcvs?rev=252894&root=gcc&view=rev
Log:
2017-09-17  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/82173
	* decl.c (gfc_get_pdt_instance): Use the component initializer
	expression for the default, rather than the parameter value.
	* resolve.c (resolve_pdt): New function.
	(resolve_symbol): Call it. Remove false error, prohibiting
	deferred type parameters for dummy arguments.

	PR fortran/60483
	* primary.c (gfc_match_varspec): If the type of an associate
	name is unknown and yet there is a match, try resolving the
	target expression and using its type.

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

	PR fortran/82173
	* gfortran.dg/pdt_1.f03 : Eliminate spurious error checks.
	* gfortran.dg/pdt_2.f03 : The same.
	* gfortran.dg/pdt_3.f03 : The same.
	* gfortran.dg/pdt_4.f03 : Add 'modtype' and two new errors in
	module 'bad_vars'. Add error concerning assumed parameters and
	save attribute.
	* gfortran.dg/pdt_11.f03 : New test.

	PR fortran/60483
	* gfortran.dg/associate_9.f90 : Remove XFAIL and change to run.
	* gfortran.dg/associate_25.f90 : New test.
	* gfortran.dg/pdt_12.f03 : New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/associate_25.f90
    trunk/gcc/testsuite/gfortran.dg/pdt_11.f03
    trunk/gcc/testsuite/gfortran.dg/pdt_12.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/associate_9.f03
    trunk/gcc/testsuite/gfortran.dg/pdt_1.f03
    trunk/gcc/testsuite/gfortran.dg/pdt_2.f03
    trunk/gcc/testsuite/gfortran.dg/pdt_3.f03
    trunk/gcc/testsuite/gfortran.dg/pdt_4.f03
Comment 5 kargls 2022-05-18 20:37:07 UTC
Remove PR 82243 from "Depends On" as it isn't a PDT bug.