[Ada] ACATS BDC1002 shall not error on arbitrary aspect
authorEtienne Servais <servais@adacore.com>
Wed, 3 Nov 2021 14:48:42 +0000 (15:48 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 10 Nov 2021 08:57:41 +0000 (08:57 +0000)
commit5fc6b47ac69605297ade8ff79468eaa836d707a0
tree78f650470847818392a34fb539fa4b96ddda0aa2
parent301526488738f16fa1018a2f1c9ce3138ecdf2cb
[Ada] ACATS BDC1002 shall not error on arbitrary aspect

gcc/ada/

* aspects.adb, aspects.ads (Is_Aspect_Id): New function.
* namet-sp.ads, namet-sp.adb (Aspect_Spell_Check,
Attribute_Spell_Check): New Functions.
* par-ch13.adb (Possible_Misspelled_Aspect): Removed.
(With_Present): Use Aspect_Spell_Check, use Is_Aspect_Id.
(Get_Aspect_Specifications): Use Aspect_Spell_Check,
Is_Aspect_Id, Bad_Aspect.
* par-sync.adb (Resync_Past_Malformed_Aspect): Use Is_Aspect_Id.
* sem_ch13.adb (Check_One_Attr): Use Is_Aspect_Id.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Introduce the Process_No_Specification_Of_Aspect, emit a warning
instead of an error on unknown aspect, hint for typos.
Introduce Process_No_Use_Of_Attribute to add spell check for
attributes too.
(Set_Error_Msg_To_Profile_Name): Use Is_Aspect_Id.
* sem_util.adb (Bad_Attribute): Use Attribute_Spell_Check.
(Bad_Aspect): New function.
* sem_util.ads (Bad_Aspect): New function.
gcc/ada/aspects.adb
gcc/ada/aspects.ads
gcc/ada/namet-sp.adb
gcc/ada/namet-sp.ads
gcc/ada/par-ch13.adb
gcc/ada/par-sync.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads