ada: Use static references to tag in more cases for interface objects
commit39a7b603380c6f4383357a6ae1d6c516dc677f29
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 7 Jan 2023 21:05:58 +0000 (7 22:05 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 16 Jan 2023 14:44:55 +0000 (16 15:44 +0100)
treea178a36edc550e9e6cdb4eb883920afc6843c1bd
parentb7ed6c43a80e06082baad5336be0fa943a878d40
ada: Use static references to tag in more cases for interface objects

This extends the use of static references to the interface tag in more cases
for (class-wide) interface objects, e.g. for initialization expressions that
are qualified aggregates or nondispatching calls returning a specific tagged
type implementing the interface.

gcc/ada/

* exp_util.ads (Has_Tag_Of_Type): Declare.
* exp_util.adb (Has_Tag_Of_Type): Move to package level.  Recurse on
qualified expressions.
* exp_ch3.adb (Expand_N_Object_Declaration): Use a static reference
to the interface tag in more cases for class-wide interface objects.
gcc/ada/exp_ch3.adb
gcc/ada/exp_util.adb
gcc/ada/exp_util.ads