diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-05-06 12:13:44 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-05-06 12:13:44 +0200 |
commit | 965dbd5cd42af356796e931419edc70bb52854f2 (patch) | |
tree | 330f088031f5a97cd7c1af94dc6cf9753624fa1b | |
parent | 895225568c89bc48d317b258c6fc2dbd56697dd0 (diff) | |
download | gcc-965dbd5cd42af356796e931419edc70bb52854f2.zip gcc-965dbd5cd42af356796e931419edc70bb52854f2.tar.gz gcc-965dbd5cd42af356796e931419edc70bb52854f2.tar.bz2 |
Revert previous change.
From-SVN: r147166
-rw-r--r-- | gcc/ada/sem_aggr.adb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index b265f73..34ad94f 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -3071,20 +3071,26 @@ package body Sem_Aggr is Parent_Typ_List := New_Elmt_List; -- If this is an extension aggregate, the component list must - -- include all components that are not in the given ancestor - -- type. Otherwise, the component list must include components - -- of all ancestors, starting with the root. + -- include all components that are not in the given ancestor type. + -- Otherwise, the component list must include components of all + -- ancestors, starting with the root. if Nkind (N) = N_Extension_Aggregate then + -- Handle case where ancestor part is a C++ constructor. In + -- this case it must be a function returning a class-wide type. -- If the ancestor part is a C++ constructor, then it must be a - -- function returning a class-wide type, so check that here. + -- function returning a class-wide type, so handle that here. - pragma Assert - (not Is_CPP_Constructor_Call (Ancestor_Part (N)) - or else Is_Class_Wide_Type (Etype (Ancestor_Part (N)))); + if Is_CPP_Constructor_Call (Ancestor_Part (N)) then + pragma Assert + (Is_Class_Wide_Type (Etype (Ancestor_Part (N)))); + Root_Typ := Root_Type (Etype (Ancestor_Part (N))); - Root_Typ := Base_Type (Etype (Ancestor_Part (N))); + -- Normal case, not a C++ constructor + else + Root_Typ := Base_Type (Etype (Ancestor_Part (N))); + end if; else Root_Typ := Root_Type (Typ); |