ada: Adjust locations in aspects on generic formal subprograms
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 28 Oct 2022 20:15:53 +0000 (22:15 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 14 Nov 2022 13:46:50 +0000 (14:46 +0100)
commit28e5c45bd519aa363cba1eec4d215b173c360cab
tree23ce86eb6735013dac0b15649618bbdc77424718
parent35f29cfe9f6e48dc570d4cd61b906c3cbb2e227a
ada: Adjust locations in aspects on generic formal subprograms

When instantiating a generic that has formal subprogram parameter with
contracts, e.g.:

  generic
    with procedure P with Pre => ..., Post => ...;
  ...

we create a wrapper that executes Pre/Post contracts before/after
calling the actual subprogram. Errors emitted for these contracts
will now have locations of the instance and not just of the generic.

gcc/ada/

* sem_ch12.adb (Build_Subprogram_Wrappers): Adjust slocs of the
copied aspects, just like we do in Build_Class_Wide_Expression for
inherited class-wide contracts.
gcc/ada/sem_ch12.adb