Bug 25093 - PUBLIC function of PRIVATE type
Summary: PUBLIC function of PRIVATE type
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2005-11-26 18:05 UTC by Joost VandeVondele
Modified: 2006-01-28 21:15 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-11-30 12:36:58


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2005-11-26 18:05:46 UTC
using GNU Fortran 95 (GCC) 4.1.0 20051126 (prerelease)  with '-g -pedantic -std=f95', I get a bad / no diagnostic for the following invalid code:

MODULE M1
 TYPE T1
  INTEGER :: I
 END TYPE T1
 PRIVATE :: T1
 PUBLIC  :: F1
CONTAINS
 TYPE(T1) FUNCTION F1()
 END FUNCTION
END MODULE

 USE M1
 END
Comment 1 eedelman 2005-11-30 12:36:58 UTC
Confirmed.
Comment 2 eedelman 2006-01-08 00:14:55 UTC
Working on a patch.
Comment 3 eedelman 2006-01-08 17:53:01 UTC
Subject: Bug 25093

Author: eedelman
Date: Sun Jan  8 17:52:57 2006
New Revision: 109474

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109474
Log:
fortran/
2005-01-08  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/25093
        * resolve.c (resolve_fntype): Check that PUBLIC functions
         aren't of PRIVATE type.

testsuite/
2005-01-08  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/25093
        * gfortran.dg/private_type_4.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/private_type_4.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 eedelman 2006-01-09 16:19:27 UTC
Subject: Bug 25093

Author: eedelman
Date: Mon Jan  9 16:19:22 2006
New Revision: 109500

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109500
Log:
fortran/
2005-01-09  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/25093
        * resolve.c (resolve_fntype): Check that PUBLIC functions
        aren't of PRIVATE type.

testsuite/
2005-01-09  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/25093
        * gfortran.dg/private_type_4.f90: New.


Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/private_type_4.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/resolve.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

Comment 5 eedelman 2006-01-09 16:21:02 UTC
Fixed on 4.1 and mainline.