Commit bd38b431 by Arnaud Charlet

[multiple changes]

2011-09-02  Robert Dewar  <dewar@adacore.com>

	* sem_ch4.adb, sem_ch6.adb: Minor reformatting.
	* gcc-interface/Make-lang.in: Update dependencies.

2011-09-02  Marc Sango  <sango@adacore.com>

	* sem_ch3.adb (Analyze_Object_Declaration): Change
	comment and add additional check to differentiate constant of
	type string from others unconstrained type.

From-SVN: r178462
parent 99d520ad
2011-09-02 Robert Dewar <dewar@adacore.com>
* sem_ch4.adb, sem_ch6.adb: Minor reformatting.
* gcc-interface/Make-lang.in: Update dependencies.
2011-09-02 Marc Sango <sango@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): Change
comment and add additional check to differentiate constant of
type string from others unconstrained type.
2011-09-02 Ed Schonberg <schonberg@adacore.com>
* sinfo.ads, sinfo.adb: New semantic attribute Premature_Use,
......
......@@ -1506,13 +1506,14 @@ ada/bindgen.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/bindusg.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/bindusg.ads ada/bindusg.adb \
ada/debug.ads ada/hostparm.ads ada/interfac.ads ada/namet.ads \
ada/namet.adb ada/opt.ads ada/osint.ads ada/output.ads ada/system.ads \
ada/s-exctab.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
ada/s-secsta.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \
ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads
ada/debug.ads ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads \
ada/namet.ads ada/namet.adb ada/opt.ads ada/osint.ads ada/output.ads \
ada/switch.ads ada/system.ads ada/s-exctab.ads ada/s-memory.ads \
ada/s-os_lib.ads ada/s-parame.ads ada/s-secsta.ads ada/s-stalib.ads \
ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads \
ada/widechar.ads
ada/butil.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/butil.ads ada/butil.adb \
......@@ -2562,21 +2563,21 @@ ada/exp_smem.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/exp_strm.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
ada/elists.ads ada/exp_strm.ads ada/exp_strm.adb ada/exp_tss.ads \
ada/exp_util.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
ada/hostparm.ads ada/interfac.ads ada/lib.ads ada/namet.ads \
ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
ada/rtsfind.ads ada/sem_aux.ads ada/sem_aux.adb ada/sem_util.ads \
ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
ada/s-rident.ads ada/s-secsta.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \
ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
ada/urealp.ads ada/widechar.ads
ada/elists.ads ada/elists.adb ada/exp_strm.ads ada/exp_strm.adb \
ada/exp_tss.ads ada/exp_util.ads ada/get_targ.ads ada/gnat.ads \
ada/g-htable.ads ada/hostparm.ads ada/interfac.ads ada/lib.ads \
ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
ada/rident.ads ada/rtsfind.ads ada/sem_aux.ads ada/sem_aux.adb \
ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/exp_tss.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
......@@ -2624,18 +2625,19 @@ ada/exp_util.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_disp.ads ada/sem_eval.ads \
ada/sem_eval.adb ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads \
ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \
ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
ada/styleg.ads ada/styleg.adb ada/stylesw.ads ada/system.ads \
ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \
ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
ada/urealp.adb ada/validsw.ads ada/widechar.ads
ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
ada/sprint.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
ada/style.ads ada/styleg.ads ada/styleg.adb ada/stylesw.ads \
ada/system.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads \
ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/types.adb \
ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \
ada/widechar.ads
ada/exp_vfpt.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
......
......@@ -3320,12 +3320,11 @@ package body Sem_Ch3 is
-- In SPARK, a declaration of unconstrained type is allowed
-- only for constants of type string.
-- Why no check for Comes_From_Source here, seems wrong ???
-- Where is check to differentiate string case ???
Check_SPARK_Restriction
("declaration of object of unconstrained type not allowed",
E);
if Nkind (E) = N_String_Literal then
Check_SPARK_Restriction
("declaration of object of unconstrained type not allowed",
E);
end if;
-- Unconstrained variables not allowed in Ada 83 mode
......
......@@ -4322,7 +4322,8 @@ package body Sem_Ch4 is
Error_Msg_Node_2 := First_Subtype (Prefix_Type);
Error_Msg_NE ("no selector& for}", N, Sel);
-- If prefix is incomplete, dd information.
-- If prefix is incomplete, dd information
-- What is dd???
if Is_Incomplete_Type (Type_To_Use) then
declare
......@@ -4332,11 +4333,13 @@ package body Sem_Ch4 is
if From_With_Type (Scope (Type_To_Use)) then
Error_Msg_NE
("\limited view of& has no components", N, Inc);
else
Error_Msg_NE
("\premature usage of incomplete type&", N, Inc);
if
Nkind (Parent (Inc)) = N_Incomplete_Type_Declaration
if Nkind (Parent (Inc)) =
N_Incomplete_Type_Declaration
then
Set_Premature_Use (Parent (Inc), N);
end if;
......
......@@ -5550,17 +5550,20 @@ package body Sem_Ch6 is
declare
E : constant Entity_Id := Entity (N);
begin
-- ???Quantified expressions get analyzed later, so E can be
-- empty at this point. In this case, we suppress the
-- ???Quantified expressions get analyzed later, so E can
-- be empty at this point. In this case, we suppress the
-- warning, just in case E is assignable. It seems better to
-- have false negatives than false positives. At some point,
-- we should make the warning more accurate, either by
-- analyzing quantified expressions earlier, or moving this
-- processing later.
-- analyzing quantified expressions earlier, or moving
-- this processing later.
if No (E) or else
(Is_Entity_Name (N) and then Ekind (E) in Assignable_Kind)
if No (E)
or else
(Is_Entity_Name (N)
and then Ekind (E) in Assignable_Kind)
then
Found := True;
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