This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/46152] ALLOCATE with type-spec fails for intrinsic types
- From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 25 Oct 2010 00:33:58 +0000
- Subject: [Bug fortran/46152] ALLOCATE with type-spec fails for intrinsic types
- Auto-submitted: auto-generated
- References: <bug-46152-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46152
--- Comment #9 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2010-10-25 00:33:49 UTC ---
On Sat, Oct 23, 2010 at 06:50:21PM +0000, burnus at gcc dot gnu.org wrote:
>
> Compiling the following program:
>
> implicit none ! << crucial
> integer, allocatable :: a
> allocate (integer :: a)
> end
>
> Fails with:
>
> allocate (integer :: a)
> 1
> Error: Symbol 'integer' at (1) has no IMPLICIT type
>
I believe that this is due to gfc_match_symbol() in
match_derived_type_spec(). If I understand gfc_match_symbol()
correctly, then 'integer' is added to the symbol table
of the current namespace. When match_derived_type_spec()
returns either MATCH_NO or MATCH_ERROR, it does not clean
up the namespace.