This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Ada] Legality checks involving aspect Import
- From: Mike Stump <mikestump at comcast dot net>
- To: Arnaud Charlet <charlet at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Ed Schonberg <schonberg at adacore dot com>
- Date: Fri, 1 Aug 2014 09:11:29 -0700
- Subject: Re: [Ada] Legality checks involving aspect Import
- Authentication-results: sourceware.org; auth=none
- References: <20140801101606 dot GA27244 at adacore dot com>
On Aug 1, 2014, at 3:16 AM, Arnaud Charlet <charlet@adacore.com> wrote:
> This patch adds some missing legality checks
No, GNU English doesn’t have us using legal/illegal unless the motivation is a law of some specific jurisdiction.
> q.ads:2:28: imported entities cannot have explicit initialization (RM 8.1 (24))
> q.ads:6:24: no initialization allowed for declaration of "J" at line 5
> q.ads:6:24: imported entities cannot be initialized (RM B.1(24))
> q.ads:9:24: no initialization allowed for declaration of "K" at line 8
> q.ads:9:24: imported entities cannot be initialized (RM B.1(24))
There are ok, but…
> * sem_ch13.adb (Analyze_Aspect_Specifications, case Aspect_Import):
> Set Is_Imported flag at once, to simplify subsequent legality
Not this.
> checks. Reject the aspect on an object whose declaration has an
> explicit initial value.
> * sem_prag.adb (Process_Import_Or_Interface): Use original node
> to check legality of an initial value for an imported entity.
Nor this.