limited1.adb
136 Bytes
-
[Ada] Illegal copy of limited object · 6ae40af3
This patch fixes a spurious copy of a limited object, when that object is a discriminated record component of a limited type LT, and the enclosing record is initialized by means of an aggregate, one of whose components is a call to a build-in-place function that returns an unconstrained object of type T. 2018-05-31 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * checks.adb (Apply_Discriminant_Check): Do not apply discriminant check to a call to a build-in-place function, given that the return object is limited and cannot be copied. gcc/testsuite/ * gnat.dg/limited1.adb, gnat.dg/limited1_inner.adb, gnat.dg/limited1_inner.ads, gnat.dg/limited1_outer.adb, gnat.dg/limited1_outer.ads: New testcase. From-SVN: r261009
Ed Schonberg committed