Bug 20836 - Public derived type with private derived type component
Summary: Public derived type with private derived type component
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P2 minor
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2005-04-08 15:49 UTC by Joost VandeVondele
Modified: 2006-01-01 05:28 UTC (History)
1 user (show)

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


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:49:26 UTC
The following is non-standard and the compiler should probably generate a
warning/error with '-pedantic -std=f95'

MODULE TEST
  PRIVATE
  TYPE info_type
   INTEGER :: value
  END TYPE info_type
  TYPE all_type
    TYPE(info_type) :: info
  END TYPE
  PUBLIC :: all_type
END MODULE
END
Comment 1 Francois-Xavier Coudert 2005-04-09 19:00:32 UTC
Confirmed and marked as minor.

For info, Intel compiler says:
"Component INFO of PUBLIC type ALL_TYPE cannot have a type that is PRIVATE"
Comment 2 Paul Thomas 2005-12-19 17:25:24 UTC
This is fixed in all three branches;

 In file pr20836.f90:6

  TYPE all_type
              1
Error: The component 'info' is a PRIVATE type and cannot be a component of 'all_type', which is PUBLIC at (1)

This was fixed by my patch of 2005-10-01 - I must have missed this PR.

Paul