Bug 20857 - accepts non-variable as actual argument for intent(inout) dummy arg
Summary: accepts non-variable as actual argument for intent(inout) dummy arg
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Paul Thomas
URL:
Keywords: accepts-invalid
: 18578 20859 25074 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-08 15:54 UTC by Joost VandeVondele
Modified: 2006-01-30 12:38 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-30 17:12:41


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2005-04-08 15:54:49 UTC
The following is non-standard and the compiler should probably generate a
warning/error with '-pedantic -std=f95'

MODULE TEST
CONTAINS
 SUBROUTINE TT(I)
   INTEGER, INTENT(inOUT) :: I
 END SUBROUTINE TT
END MODULE TEST
USE TEST
CALL TT(0)
END
Comment 1 Francois-Xavier Coudert 2005-04-10 08:47:16 UTC
Confirmed. As g95 says: "Argument for parameter 'i' at (1) is INTENT(INOUT) and
actual argument is not a variable".
Comment 2 Tobias Schlüter 2005-12-07 16:47:26 UTC
*** Bug 25074 has been marked as a duplicate of this bug. ***
Comment 3 Tobias Schlüter 2005-12-07 16:47:36 UTC
*** Bug 20859 has been marked as a duplicate of this bug. ***
Comment 4 Tobias Schlüter 2005-12-07 16:49:48 UTC
These all amount to the same problem.  Being a bit more descriptive would also make searching for duplicates easier.
Comment 5 Paul Thomas 2005-12-15 15:01:47 UTC
(In reply to comment #4)
> These all amount to the same problem.  Being a bit more descriptive would also
> make searching for duplicates easier.

I believe that this is a duplicate of 18578 too.

Paul
Comment 6 Andrew Pinski 2006-01-01 05:58:55 UTC
*** Bug 18578 has been marked as a duplicate of this bug. ***
Comment 7 Paul Thomas 2006-01-29 16:31:30 UTC
Subject: Bug 20857

Author: pault
Date: Sun Jan 29 16:31:24 2006
New Revision: 110376

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110376
Log:
2006-01-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/18578
	PR fortran/18579
	PR fortran/20857
	PR fortran/20885
	* interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
	if actual argument is not a variable.

2006-01-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/18578
	PR fortran/18579
	PR fortran/20857
	PR fortran/20885
	* gfortran.dg/intent_out_1.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/intent_out_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/interface.c
    trunk/gcc/testsuite/ChangeLog

Comment 8 Paul Thomas 2006-01-30 05:45:12 UTC
Subject: Bug 20857

Author: pault
Date: Mon Jan 30 05:45:06 2006
New Revision: 110394

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110394
Log:
2006-01-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/18578
	PR fortran/18579
	PR fortran/20857
	PR fortran/20885
	* interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
	if actual argument is not a variable.

	PR fortran/17911
	* expr.c (gfc_check_assign, gfc_check_pointer_assign): Emit error if
	the lvalue is a use associated procedure.

	PR fortran/20895
	PR fortran/25030
	* expr.c (gfc_check_pointer_assign): Emit error if lvalue and rvalue
	character lengths are not the same.  Use gfc_dep_compare_expr for the
	comparison.
	* gfortran.h: Add prototype for gfc_dep_compare_expr.
	* dependency.h: Remove prototype for gfc_dep_compare_expr.

2006-01-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/18578
	PR fortran/18579
	PR fortran/20857
	PR fortran/20885
	* gfortran.dg/intent_out_1.f90: New test.

	PR fortran/17911
	* gfortran.dg/procedure_lvalue.f90: New test.

	PR fortran/20895
	PR fortran/25030
	* gfortran.dg/char_pointer_assign_2.f90: New test.
	* gfortran.dg/char_result_1.f90: Correct unequal charlen pointer
	assignment to be consistent with standard.
	* gfortran.dg/char_result_2.f90: The same.
	* gfortran.dg/char_result_8.f90: The same.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/char_pointer_assign_2.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/intent_out_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/procedure_lvalue.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/dependency.h
    branches/gcc-4_1-branch/gcc/fortran/expr.c
    branches/gcc-4_1-branch/gcc/fortran/gfortran.h
    branches/gcc-4_1-branch/gcc/fortran/interface.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/char_result_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/char_result_2.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/char_result_8.f90

Comment 9 Paul Thomas 2006-01-30 05:47:56 UTC
Fixed on trunk and 4.1.

Paul