This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Proper handling of formal packages without explicit associations.


In Ada 2005, if a formal package has partial parametrizations, each formal
that is not specified in the formal package declaration retains its formal
declaration in the local instance created for it. If the formal has no
associations at all, this is not equivalent to an instantion with a box
default. Previously a formal package without associations was treated as
if it had a box present, leading to malformed trees for ASIS.

In Ada2005 a formal package declaration such as:
    with package Inst is new G;
is not equivalent to either of:
    with package Inst ins new G(<>);
    with package Inst ins new G(others => <>);

The first one is legal if all formal parameters of G have defaults, and the
formals are not visible outside of Inst. This is distinct from the visibility
rules for the other cases.

2007-09-10  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.adb (Build_Local_Package): A formal package with no
	associations is legal if all formals have defaults. It is not
	equivalent to a formal declared with a box.
	Update to GPLv3.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]