allocator2.ads
453 Bytes
-
[Ada] Avoid crash in GNATprove_Mode on allocator inside type · ebad47fc
In the special mode for GNATprove, subtypes should be declared for allocators when constraints are used. This was done previously but it does not work inside spec expressions, as the declaration is not inserted and analyzed in the AST in that case, leading to a later crash on an incomplete entity. Thus, no declaration should be created in such a case, letting GNATprove later reject such code due to the use of an allocator in an interfering context. 2019-08-13 Yannick Moy <moy@adacore.com> gcc/ada/ * sem_ch4.adb (Analyze_Allocator): Do not insert subtype declaration for allocator inside a spec expression. gcc/testsuite/ * gnat.dg/allocator2.adb, gnat.dg/allocator2.ads: New testcase. From-SVN: r274345
Yannick Moy committed