Commit 9a7e930f by Arnaud Charlet

[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
parent 868df137
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.
2011-12-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2011-12-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* s-oscons-tmplt.c [__alpha__ && __osf__] (_XOPEN_SOURCE): Define. * s-oscons-tmplt.c [__alpha__ && __osf__] (_XOPEN_SOURCE): Define.
......
...@@ -9640,37 +9640,39 @@ package body Sem_Ch3 is ...@@ -9640,37 +9640,39 @@ package body Sem_Ch3 is
end loop; end loop;
end Check_Completion; 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)); Tdef : constant Node_Id := Type_Definition (Declaration_Node (T));
Clist : Node_Id; Clist : Node_Id;
Comp : Node_Id; Comp : Node_Id;
begin begin
-- Obtain the component list
if Nkind (Tdef) = N_Record_Definition then if Nkind (Tdef) = N_Record_Definition then
Clist := Component_List (Tdef); 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)); Clist := Component_List (Record_Extension_Part (Tdef));
end if; end if;
-- Check all components to ensure no default expressions
if Present (Clist) then if Present (Clist) then
Comp := First (Component_Items (Clist)); Comp := First (Component_Items (Clist));
while Present (Comp) loop while Present (Comp) loop
if Present (Expression (Comp)) then if Present (Expression (Comp)) then
Error_Msg_N Error_Msg_N
("component of imported 'C'P'P type cannot have" & ("component of imported 'C'P'P type cannot have "
" default expression", Expression (Comp)); & "default expression", Expression (Comp));
end if; end if;
Next (Comp); Next (Comp);
end loop; end loop;
end if; end if;
end Check_CPP_Type; end Check_CPP_Type_Has_No_Defaults;
---------------------------- ----------------------------
-- Check_Delta_Expression -- -- Check_Delta_Expression --
...@@ -18130,7 +18132,7 @@ package body Sem_Ch3 is ...@@ -18130,7 +18132,7 @@ package body Sem_Ch3 is
-- Check that components of imported CPP types do not have default -- Check that components of imported CPP types do not have default
-- expressions. -- expressions.
Check_CPP_Type (Full_T); Check_CPP_Type_Has_No_Defaults (Full_T);
end if; end if;
-- If the private view has user specified stream attributes, then so has -- If the private view has user specified stream attributes, then so has
......
...@@ -115,7 +115,7 @@ package Sem_Ch3 is ...@@ -115,7 +115,7 @@ package Sem_Ch3 is
-- and errors are posted on that node, rather than on the declarations that -- and errors are posted on that node, rather than on the declarations that
-- require completion in the package declaration. -- require completion in the package declaration.
procedure Check_CPP_Type (T : Entity_Id); procedure Check_CPP_Type_Has_No_Defaults (T : Entity_Id);
-- Check that components of imported CPP type T do not have default -- Check that components of imported CPP type T do not have default
-- expressions because the constructor (if any) is on the C++ side. -- expressions because the constructor (if any) is on the C++ side.
......
...@@ -4604,11 +4604,12 @@ package body Sem_Prag is ...@@ -4604,11 +4604,12 @@ package body Sem_Prag is
elsif C = Convention_CPP elsif C = Convention_CPP
and then (Is_Record_Type (Def_Id) and then (Is_Record_Type (Def_Id)
or else Ekind (Def_Id) = E_Incomplete_Type) or else Ekind (Def_Id) = E_Incomplete_Type)
then then
if Ekind (Def_Id) = E_Incomplete_Type then if Ekind (Def_Id) = E_Incomplete_Type then
if Present (Full_View (Def_Id)) then if Present (Full_View (Def_Id)) then
Def_Id := Full_View (Def_Id); Def_Id := Full_View (Def_Id);
else else
Error_Msg_N Error_Msg_N
("cannot import 'C'P'P type before full declaration seen", ("cannot import 'C'P'P type before full declaration seen",
...@@ -4650,7 +4651,7 @@ package body Sem_Prag is ...@@ -4650,7 +4651,7 @@ package body Sem_Prag is
-- full view is analyzed (see Process_Full_View). -- full view is analyzed (see Process_Full_View).
if not Is_Private_Type (Def_Id) then if not Is_Private_Type (Def_Id) then
Check_CPP_Type (Def_Id); Check_CPP_Type_Has_No_Defaults (Def_Id);
end if; end if;
elsif Nkind (Parent (Def_Id)) = N_Incomplete_Type_Declaration then elsif Nkind (Parent (Def_Id)) = N_Incomplete_Type_Declaration then
...@@ -4662,8 +4663,8 @@ package body Sem_Prag is ...@@ -4662,8 +4663,8 @@ package body Sem_Prag is
else else
Error_Pragma_Arg Error_Pragma_Arg
("second argument of pragma% must be object, subprogram" & ("second argument of pragma% must be object, subprogram "
" or incomplete type", & "or incomplete type",
Arg2); Arg2);
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment