Bug 36383 - -std=95: Reject public procedure with private derv. type argument
Summary: -std=95: Reject public procedure with private derv. type argument
Status: WAITING
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.4.0
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid, diagnostic
Depends on:
Blocks:
 
Reported: 2008-05-29 21:18 UTC by Tobias Burnus
Modified: 2019-02-05 17:07 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-03-29 08:25:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2008-05-29 21:18:23 UTC
See:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/12ac1683f64da0b8

 ! type t_a is public; type t_b is private
 interface operator(+)
   module procedure add_t_a, add_t_b
 end interface
contains
 pure function add_t_a(a1,a2) result(a)
   type(t_a) :: a
   type(t_a), intent(in) :: a1, a2
 pure function add_t_b(b1,b2) result(b)
   type(t_b) :: b
   type(t_b), intent(in) :: b1, b2 

Using NAG the output is:
  Extension: Dummy B1 of ADD_T_B in generic + exposes PRIVATE type T_B

(Extension == Fortran 2003.)
Comment 1 Dominique d'Humieres 2019-02-05 17:07:37 UTC
Comment from Richard Maine:

> There were a bunch of restrictions like this that were removed with one
> of the Fortran revisions. I think it was between f95 and f2003. So in
> some sense, both compilers are right. You might want to look at the
> particular compiler options for controlling the version of the standard
> that messages are produced for; some compilers have multiple options
> there.
>
> It is my opinion that these restrictions were misguided in the first
> place. They achieved nothing useful and disallowed otherwise reasonable
> coding practices. I think that a majority of J3 eventually came to agree
> with that. AT any case, they did agree with removing the restrictions in
> f2003.

Am I correct to understand that an error should be emitted with -std=f95, but not with -std=f2*?

If yes, would it be a majore offense to keep the present gfortran behavior? Is there a way to document it?