aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2018-12-11 11:09:19 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-12-11 11:09:19 +0000
commit5f531feff7ed6651354ed5b1cbd2a83cf204d170 (patch)
tree516bc968672662fd2a9636ff4234661f1e7aaefd /gcc/ada/gcc-interface
parent15bdffc4963b842cf104a0075921965a3cee272b (diff)
downloadgcc-5f531feff7ed6651354ed5b1cbd2a83cf204d170.zip
gcc-5f531feff7ed6651354ed5b1cbd2a83cf204d170.tar.gz
gcc-5f531feff7ed6651354ed5b1cbd2a83cf204d170.tar.bz2
[Ada] Spurious errors on aspect specifications in generic units
This patch fixes spurious errors on aspect specifications on record types when the aspect expression references a component of the type that is not a discriminant. The patch also cleans up the legality checks on aspect specifications, and improves error message on illegal aspect specifications whose expressions are not conformant between specification and freeze point, because of changes in visibility. 2018-12-11 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch13.adb (Push_Type, Pop_Type): New procedures, used for analysis of aspect expressions for record types, whose components (not only discriminants) may be referenced in aspect expressions. (Analyze_Aspect_Specifications, Analyze_Aspects_At_Freeze_Point, Analyze_Aspect_At_End-Of_Declarations, Resolve_Aspect_Expressions): Use the new subprograms. (Check_Aspect_At_End_Of_Declarations): Improve error message. (Build_Predicate_Functions): Do not build their bodies in a generic unit. (Is_Derived_Type_With_Constraint): New subprogram to uncover and reject aspect specificationss on types that appear after the type is frozen. * sem_ch13.ads (Push_Scope_And_Install_Discriminants, Uninstall_Discriminants_And_Pop_Scope): Remove. * sem_ch6.adb, sem_ch6.ads (Fully_Conformant_Expressions): Additional parameter to improve error message on illegal aspect specifications whose resolution differ between aspect specification and freeze point. * freeze.adb: Remove references to Install/Uninstall_Discriminants. gcc/testsuite/ * gnat.dg/aspect1.adb, gnat.dg/aspect1_horizontal.adb, gnat.dg/aspect1_horizontal.ads, gnat.dg/aspect1_vectors_2d.ads: New testcase. * gnat.dg/static_pred1.adb: Expect an error message. From-SVN: r266980
Diffstat (limited to 'gcc/ada/gcc-interface')
0 files changed, 0 insertions, 0 deletions