diff mbox

[Ada] Correction to aggregates in instance bodies

Message ID 20110901132134.GA30257@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Sept. 1, 2011, 1:21 p.m. UTC
This patch fixes an obscure bug where a record aggregate would be incorrectly
flagged as illegal, when the record is inside an instance of a generic, and the
type is private.
No small test case is available.

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-09-01  Bob Duff  <duff@adacore.com>

	* sem_aggr.adb (Resolve_Aggregate): Need to treat "in instance
	body" the same as "in inlined body", because visibility shouldn't
	apply there.
diff mbox

Patch

Index: sem_aggr.adb
===================================================================
--- sem_aggr.adb	(revision 178398)
+++ sem_aggr.adb	(working copy)
@@ -1229,7 +1229,7 @@ 
 
       elsif Is_Private_Type (Typ)
         and then Present (Full_View (Typ))
-        and then In_Inlined_Body
+        and then (In_Inlined_Body or else In_Instance_Body)
         and then Is_Composite_Type (Full_View (Typ))
       then
          Resolve (N, Full_View (Typ));