comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Defaults for formal subprogram
Date: Wed, 28 Apr 2010 03:56:43 -0700 (PDT)
Date: 2010-04-28T03:56:43-07:00	[thread overview]
Message-ID: <bc3ae4af-fcda-466c-9739-940d754113fb@r18g2000yqd.googlegroups.com> (raw)
In-Reply-To: aa2387f5-b210-4cd8-a427-6db1abc542d6@j21g2000yqh.googlegroups.com

On Apr 28, 12:53 pm, Ludovic Brenta <ludo...@ludovic-brenta.org>
wrote:
> Christoph Grein wrote on comp.lang.ada:
>
>
>
> > > procedure Aaa is
>
> > >    type Proc_Ptr is access procedure;
>
> > >    X : Proc_Ptr;
>
> > >    generic
> > >       with procedure Bbb is X.all;
> > >       -- aaa.adb:8:31: expect valid subprogram name as default
> > >    package Pkg is
> > >    end Pkg;
>
> > AARM 12.6(5.b) The evaluation of the default_name takes place during
> > the elaboration of each instantiation that uses the default, as
> > defined in 12.3, “Generic Instantiation”.
>
> > So I don't see a problem.
>
> I think this violates 12.6(3/2) and 12.6(4):
>
> 3/2 subprogram_default ::= default_name | <> | null
> 4    default_name ::= name
>
> Here, you are trying to use an expression as opposed to a name.

Ah but looking further I see 4.1(2):

name ::=
     direct_name | explicit_dereference
   | indexed_component | slice
   | selected_component | attribute_reference
   | type_conversion | function_call
   | character_literal

and 4.1(5): explicit_dereference ::= name.all

so your code now seems legal to me. So this is probably a compiler
bug.

--
Ludovic Brenta.



  reply	other threads:[~2010-04-28 10:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28  9:57 Defaults for formal subprogram Maxim Reznik
2010-04-28 10:31 ` AdaMagica
2010-04-28 10:53   ` Ludovic Brenta
2010-04-28 10:56     ` Ludovic Brenta [this message]
2010-04-28 21:12   ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox