sem_ch12.adb (Check_Generic_Actuals): Use first subtype of actual when capturing...
authorEd Schonberg <schonberg@adacore.com>
Fri, 6 Apr 2007 09:26:07 +0000 (11:26 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 6 Apr 2007 09:26:07 +0000 (11:26 +0200)
commitda931119f4caeba05e524717a2ee3492aecb5bb0
tree154541d2d737450d96a02e07854151f97d5c4dd5
parent9915e6c7588b293097935167489beed31d2cbe40
sem_ch12.adb (Check_Generic_Actuals): Use first subtype of actual when capturing size information...

2007-04-06  Ed Schonberg  <schonberg@adacore.com>
    Gary Dismukes  <dismukes@adacore.com>

* sem_ch12.adb (Check_Generic_Actuals): Use first subtype of actual
when capturing size information, instead of base type, which for a
formal array type will be the unconstrained type.
(Analyze_Formal_Object_Declaration): Add check for illegal default
expressions for a formal in object of a limited type.
(Instantiate_Object): Ditto.
(Check_Formal_Package_Instance): Skip entities that are formal objects,
because they were defaulted in the formal package and no check applies
to them.
(Check_Formal_Package_Instance): Extend conformance check to other
discrete types beyond Integer.
(Process_Default): Copy directly the unmatched formal. A generic copy
has already been performed in Analyze_Formal_Package.
(Analyze_Associations): If a formal subprogram has no match, check for
partial parametrization before looking for a default, to prevent
spurious errors.
(Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation): Do
not set the instantiation environment before analyzing the actuals.
Fixes regression on 8515-003 with implementation of AI-133.
Set_Instance_Env checks whether the generic unit is a predefined
unit, in which case the instance must be analyzed with the latest Ada
mode. This setting must take place after analysis of the actuals,
because the actuals must be analyzed and frozen in the Ada mode extant
outside of the current instantiation.
(Save_Env, Restore_Env): Preserve and restore the configuration
parameters so that predefined units can be compiled in the proper Ada
mode.
(Analyze_Formal_Object_Declaration,Analyze_Formal_Subprogram,
Instantiate_Type): Split Is_Abstract flag into Is_Abstract_Subprogram
and Is_Abstract_Type.
(Analyze_Formal_Package): For better error recovery, Add exception
handler to catch Instantion_Error, which can be raised in
Analyze_Associations

From-SVN: r123593
gcc/ada/sem_ch12.adb