Commit de12d07e by Yannick Moy Committed by Pierre-Marie de Rodat

[Ada] Avoid spurious mismatch error of assertion policy in generics

2019-12-13  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_util.adb (Original_Aspect_Pragma_Name): Go through
	Original_Node for pragma.

From-SVN: r279359
parent 8973b987
2019-12-13 Yannick Moy <moy@adacore.com>
* sem_util.adb (Original_Aspect_Pragma_Name): Go through
Original_Node for pragma.
2019-12-13 Piotr Trojanek <trojanek@adacore.com>
* exp_aggr.adb, exp_unst.adb: Minor fix typo in comment.
......
......@@ -23326,13 +23326,16 @@ package body Sem_Util is
Item := Corresponding_Aspect (Item);
end if;
-- Retrieve the name of the aspect/pragma. Note that Pre, Pre_Class,
-- Retrieve the name of the aspect/pragma. As assertion pragmas from
-- a generic instantiation might have been rewritten into pragma Check,
-- we look at the original node for Item. Note also that Pre, Pre_Class,
-- Post and Post_Class rewrite their pragma identifier to preserve the
-- original name.
-- original name, so we look at the original node for the identifier.
-- ??? this is kludgey
if Nkind (Item) = N_Pragma then
Item_Nam := Chars (Original_Node (Pragma_Identifier (Item)));
Item_Nam :=
Chars (Original_Node (Pragma_Identifier (Original_Node (Item))));
else
pragma Assert (Nkind (Item) = N_Aspect_Specification);
......
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