[Ada] Reject junk expressions in attribute Update
2020-06-19 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_attr.adb (Analyze_Attribute): Reject illegal positional component associations; fix syntax in comment about named component associations.
This commit is contained in:
parent
484d58c5ba
commit
4b58985f6c
@ -6836,7 +6836,7 @@ package body Sem_Attr is
|
|||||||
-- Verify the consistency of types when the current component is
|
-- Verify the consistency of types when the current component is
|
||||||
-- part of a miltiple component update.
|
-- part of a miltiple component update.
|
||||||
|
|
||||||
-- Comp_1, ..., Comp_N => <value>
|
-- Comp_1 | ... | Comp_N => <value>
|
||||||
|
|
||||||
if Present (Etype (Comp)) then
|
if Present (Etype (Comp)) then
|
||||||
Base_Typ := Base_Type (Etype (Comp));
|
Base_Typ := Base_Type (Etype (Comp));
|
||||||
@ -6877,6 +6877,11 @@ package body Sem_Attr is
|
|||||||
|
|
||||||
elsif Nkind (E1) /= N_Aggregate then
|
elsif Nkind (E1) /= N_Aggregate then
|
||||||
Error_Attr ("attribute % requires component association list", N);
|
Error_Attr ("attribute % requires component association list", N);
|
||||||
|
|
||||||
|
elsif Present (Expressions (E1)) then
|
||||||
|
Error_Attr ("attribute % requires named component associations",
|
||||||
|
First (Expressions (E1)));
|
||||||
|
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- Inspect the update aggregate, looking at all the associations and
|
-- Inspect the update aggregate, looking at all the associations and
|
||||||
|
Loading…
Reference in New Issue
Block a user