+2018-11-14 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_ch12.adb (Instantiate_Object): Set
+ Corresponding_Generic_Association on generic actuals with
+ default expression.
+ * sinfo.ads (Corresponding_Generic_Association): Update comment.
+
2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch4.adb (Expand_Concatenate): Use the proper routine to
Expression => New_Copy_Tree
(Default_Expression (Formal)));
+ Set_Corresponding_Generic_Association
+ (Decl_Node, Expression (Decl_Node));
+
Append (Decl_Node, List);
Set_Analyzed (Expression (Decl_Node), False);
-- Corresponding_Generic_Association (Node5-Sem)
-- This field is defined for object declarations and object renaming
-- declarations. It is set for the declarations within an instance that
- -- map generic formals to their actuals. If set, the field points to
- -- a generic_association which is the original parent of the expression
- -- or name appearing in the declaration. This simplifies ASIS queries.
+ -- map generic formals to their actuals. If set, the field points either
+ -- to a copy of a default expression for an actual of mode IN or to a
+ -- generic_association which is the original parent of the expression or
+ -- name appearing in the declaration. This simplifies ASIS and GNATprove
+ -- queries.
-- Corresponding_Integer_Value (Uint4-Sem)
-- This field is set in real literals of fixed-point types (it is not
+2018-11-14 Piotr Trojanek <trojanek@adacore.com>
+
+ * gnat.dg/generic_actuals.adb: New testcase.
+
2018-11-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/87974
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-gnatd.F" }
+
+procedure Generic_Actuals with SPARK_Mode is
+ generic
+ X : Integer;
+ Y : Integer := 0;
+ package Q with Initializes => (XX => X, YY => Y) is
+ -- Both X and Y actuals can appear in the Initializes contract,
+ -- i.e. the default expression of Y should not matter.
+ XX : Integer := X;
+ YY : Integer := Y;
+ end Q;
+
+ package Inst is new Q (X => 0);
+begin
+ null;
+end Generic_Actuals;