aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-12-22 09:49:14 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2011-12-22 09:49:14 +0100
commit9a7e930fb278bb55e5387b9342d5566afb1f2c3b (patch)
treec5e4c37ce3de7ff65afc6f01b922a4a62e4bee02 /gcc/ada/sem_ch3.adb
parent868df137e65ba607dd4bdc627ed2a72b35663024 (diff)
downloadgcc-9a7e930fb278bb55e5387b9342d5566afb1f2c3b.zip
gcc-9a7e930fb278bb55e5387b9342d5566afb1f2c3b.tar.gz
gcc-9a7e930fb278bb55e5387b9342d5566afb1f2c3b.tar.bz2
[multiple changes]
2011-12-22 Vincent Pucci <pucci@adacore.com> * sem_dim.adb: Addressed all ??? comments. Replacement of warnings by errors using continuation marks. (Error_Dim_Msg_For_?): Renaming of Error_Dim_For_?. 2011-12-22 Robert Dewar <dewar@adacore.com> * sem_ch3.adb, sem_ch3.ads, sem_prag.adb: Minor code clean up. From-SVN: r182616
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb24
1 files changed, 13 insertions, 11 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 7de6f86..662f7e1 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -9640,37 +9640,39 @@ package body Sem_Ch3 is
end loop;
end Check_Completion;
- --------------------
- -- Check_CPP_Type --
- --------------------
+ ------------------------------------
+ -- Check_CPP_Type_Has_No_Defaults --
+ ------------------------------------
- procedure Check_CPP_Type (T : Entity_Id) is
+ procedure Check_CPP_Type_Has_No_Defaults (T : Entity_Id) is
Tdef : constant Node_Id := Type_Definition (Declaration_Node (T));
Clist : Node_Id;
Comp : Node_Id;
begin
+ -- Obtain the component list
+
if Nkind (Tdef) = N_Record_Definition then
Clist := Component_List (Tdef);
-
- else
- pragma Assert (Nkind (Tdef) = N_Derived_Type_Definition);
+ else pragma Assert (Nkind (Tdef) = N_Derived_Type_Definition);
Clist := Component_List (Record_Extension_Part (Tdef));
end if;
+ -- Check all components to ensure no default expressions
+
if Present (Clist) then
Comp := First (Component_Items (Clist));
while Present (Comp) loop
if Present (Expression (Comp)) then
Error_Msg_N
- ("component of imported 'C'P'P type cannot have" &
- " default expression", Expression (Comp));
+ ("component of imported 'C'P'P type cannot have "
+ & "default expression", Expression (Comp));
end if;
Next (Comp);
end loop;
end if;
- end Check_CPP_Type;
+ end Check_CPP_Type_Has_No_Defaults;
----------------------------
-- Check_Delta_Expression --
@@ -18130,7 +18132,7 @@ package body Sem_Ch3 is
-- Check that components of imported CPP types do not have default
-- expressions.
- Check_CPP_Type (Full_T);
+ Check_CPP_Type_Has_No_Defaults (Full_T);
end if;
-- If the private view has user specified stream attributes, then so has