]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Spurious error on the default value of a derived scalar type
authorJavier Miranda <miranda@adacore.com>
Tue, 23 Jul 2024 11:46:19 +0000 (11:46 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 6 Aug 2024 08:54:31 +0000 (10:54 +0200)
commit3e2b3dd728d851480bb752055bb0937cd4812ef1
tree155cb6b88e29fa19e958b2cabe7e5a5862addba0
parentb9be798a007a824376dc2995684cbaeb523aac92
ada: Spurious error on the default value of a derived scalar type

When the aspect Default_Value is inherited by a derived scalar
type, and both the parent type T and the derived type DT are
declared in the same scope, a spurious error may be reported.
This occurs if a subprogram declared in the same scope has a
parameter of type DT with a default value, leading the compiler
to incorrectly flag the default value specified in the aspect
of type T as having the wrong type.

gcc/ada/

* freeze.adb (Freeze_Entity): For scalar derived types that
inherit the aspect Default_Value, do not analyze and resolve the
inherited aspect, as the type of the aspect remains the parent
type.
gcc/ada/freeze.adb