ada: Reject misplaced pragma Obsolescent
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 7 Sep 2022 13:02:04 +0000 (15:02 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 7 Nov 2022 08:36:29 +0000 (09:36 +0100)
commit74056e9411e0457c33ff5546a3563edb9ed09c99
tree0133c4dae22535870b8f4a7aaf89f075595b0e67
parentc7dc111e9d8e2eb83e45870a98c193f2fd681313
ada: Reject misplaced pragma Obsolescent

Pragma Obsolescent appearing before declaration was putting the
Obsolescent flag on the Standard package, which is certainly wrong. The
problem was that we relied on the Find_Lib_Unit_Name routine without
sanitizing the pragma placement with Check_Valid_Library_Unit_Pragma.

Part of cleaning up the warnings machinery to better handle references
to unset objects.

gcc/ada/

* sem_prag.adb (Analyze_Pragma [Pragma_Obsolescent]): Reject
misplaced pragma.
gcc/ada/sem_prag.adb