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>
* s-oscons-tmplt.c [__alpha__ && __osf__] (_XOPEN_SOURCE): Define.
......
......@@ -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
......
......@@ -115,7 +115,7 @@ package Sem_Ch3 is
-- and errors are posted on that node, rather than on the declarations that
-- 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
-- expressions because the constructor (if any) is on the C++ side.
......
......@@ -4604,11 +4604,12 @@ package body Sem_Prag is
elsif C = Convention_CPP
and then (Is_Record_Type (Def_Id)
or else Ekind (Def_Id) = E_Incomplete_Type)
or else Ekind (Def_Id) = E_Incomplete_Type)
then
if Ekind (Def_Id) = E_Incomplete_Type then
if Present (Full_View (Def_Id)) then
Def_Id := Full_View (Def_Id);
else
Error_Msg_N
("cannot import 'C'P'P type before full declaration seen",
......@@ -4650,7 +4651,7 @@ package body Sem_Prag is
-- full view is analyzed (see Process_Full_View).
if not Is_Private_Type (Def_Id) then
Check_CPP_Type (Def_Id);
Check_CPP_Type_Has_No_Defaults (Def_Id);
end if;
elsif Nkind (Parent (Def_Id)) = N_Incomplete_Type_Declaration then
......@@ -4662,8 +4663,8 @@ package body Sem_Prag is
else
Error_Pragma_Arg
("second argument of pragma% must be object, subprogram" &
" or incomplete type",
("second argument of pragma% must be object, subprogram "
& "or incomplete type",
Arg2);
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