]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Improved support for incomplete parameter types
authorSteve Baird <baird@adacore.com>
Thu, 5 Sep 2024 20:42:20 +0000 (13:42 -0700)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 8 Oct 2024 08:37:13 +0000 (10:37 +0200)
commit0f7e027e7773fbab82b24e08f60c6da7d3f913a5
tree3298d9b863baa53ece1df2aec200b6fba5907505
parent0171938cfc357ed43c2b95ddee504f614cac7982
ada: Improved support for incomplete parameter types

Fix two bugs uncovered by a recent ACATS test C3A1005: a freezing problem
and a case where a user-defined equality function for an incomplete type
was incorrectly hidden from use-clause visibility by the "corresponding"
predefined op (which doesn't actually exist).

gcc/ada/ChangeLog:

* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Don't freeze here
if Has_Delayed_Freeze returns True.
* sem_type.adb (Valid_Equality_Arg): Treat an incomplete type like
a limited type because neither has an implicitly-defined equality
primitive.
(Covers): If either argument is an incomplete type
whose full view is available, then look through to the full view.
* sem_res.adb (Resolve_Actuals): If the actual parameter type is
complete and the formal parameter type is not, then update the
formal parameter type to use the complete view.
gcc/ada/sem_ch6.adb
gcc/ada/sem_res.adb
gcc/ada/sem_type.adb