This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: ada/5690: renaming subprograms and default_expression
- From: gnat-dev at buzco dot nyct dot net
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 24 Apr 2002 12:26:02 -0000
- Subject: Re: ada/5690: renaming subprograms and default_expression
- Reply-to: gnat-dev at buzco dot nyct dot net
The following reply was made to PR ada/5690; it has been noted by GNATS.
From: gnat-dev@buzco.nyct.net
To: gcc-gnats@gcc.gnu.org
Cc: fw@deneb.enyo.de
Subject: Re: ada/5690: renaming subprograms and default_expression
Date: Wed, 24 Apr 2002 08:20:19 -0400
On 02-02-14 16:01:49 fw@deneb.enyo.de wrote:
| > Number: 5690
| > Category: ada
| > Synopsis: renaming subprograms and default_expression
| > Confidential: no
| > Severity: critical
| > Priority: high
| > Responsible: unassigned
| > State: open
| > Class: rejects-legal
| > Submitter-Id: net
| > Arrival-Date: Thu Feb 14 08:06:00 PST 2002
| > Closed-Date:
| > Last-Modified:
| > Originator: fw@deneb.enyo.de
| > Release: GCC 3.1 2002-02-12
| > Organization:
| > Environment:
| Debian GNU/Linux unstable, x86
| > Description:
| The attached program appears to be legal, but compilation results in the following error messages:
| defaults.adb:6:14: not fully conformant with declaration at line 4
| defaults.adb:6:14: default expression for "X" does not match
| > How-To-Repeat:
| Compile the attached program.
| > Fix:
=== End quoted text ===
This is "questionable, but should be legal" code !
The relevant part of the RM (§ 8.5.4 Subprogram Renaming Declarations)
defines in ¶ 1 :
1. A subprogram_renaming_declaration can serve as the completion of a
subprogram_declaration; such a renaming_declaration is called a
renaming-as-body. A subprogram_renaming_declaration that is not a
completion is called a renaming-as-declaration, and is used to
rename a subprogram ...
(This can be read at
http://buzco.nyct.net/Programming/lang/Ada/gnat/3.14/arm95/arm95_134.html
most of the time (I have about 90 % availability), and is of course in
the RM shipped w/ gnat-3.14 and I guess w/ the new gcc-ada docs.)
Your sample tries to change the default argument w/ a renaming-as-body,
which I can see could be useful at times. The RM does +not+ explicitly
state that this is legal, and all the examples show a
renaming-as-declaration.
GNAT-3.14p exhibits similar behaviour.
I will map out the scope of the problem (eg, what happens if this is a
package w/ "original" defined in another pkg, etc) and see if I can
track down the code.
Meanwhile, if some Compiler Lawyer can identify if this is really a bug
in the compiler or just the manual, that would help.
--
Buz Cory of BuzCo Systems -- New York NY USA http://BuzCo.nyct.net
<gnat-dev@BuzCo.nyct.net> (Buz as GNAT Programmer)
write to <helpdesk@BuzCo.nyct.net> for FREE help with:
Installing/Configuring Linux
Getting started with the Ada Programming Language.
Friends don't let friends do DOS; Linux to the rescue!
Ada 95 is here! Why use an archaic, bug-prone language?