]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix long-standing issue with qualified expressions of class-wide types
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 10 Feb 2026 19:09:59 +0000 (20:09 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 26 May 2026 08:38:23 +0000 (10:38 +0200)
commit6a23ada5e3cd2c2757dfcd9779fb3dd1e5eaec57
tree6b694d6bd39950ea0b0fa97d11e18dd21c5d3c78
parentc59cf4fb4f70564286fa686a305193048e0df9a5
ada: Fix long-standing issue with qualified expressions of class-wide types

Given the very specific name resolution rules for qualified expressions, the
Covers predicate cannot be used when the qualified expression is of a class-
wide type and, therefore, Analyze_Qualified_Expression needs to resort to a
stricter type compatibility analysis. But, unlike Covers, it fails to factor
out the limited views of the types, which may lead to spurious errors.

gcc/ada/ChangeLog:

* sem_ch4.adb (Analyze_Qualified_Expression): For a class-wide type,
check for an exact match modulo the Non_Limited_View attribute.
gcc/ada/sem_ch4.adb