]> git.ipfire.org Git - thirdparty/gcc.git/commit
Ada: Add missing guard before accessing the Underlying_Record_View field
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 14 Jul 2025 10:11:44 +0000 (12:11 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 14 Jul 2025 11:46:57 +0000 (13:46 +0200)
commit762ca0be09e00d02a72bd65fe8c3027a056d4a81
treef4ae20824443b7f5b93485766dc2ae85c1704dcf
parentfcc6ce1a4934a45bfd4e8e21e118d3f1046d3d85
Ada: Add missing guard before accessing the Underlying_Record_View field

It is necessary when GNAT extensions are enabled (-gnatX switch).

gcc/ada/
PR ada/121056
* sem_ch4.adb (Try_Object_Operation.Try_Primitive_Operation): Add
test on Is_Record_Type before accessing Underlying_Record_View.

gcc/testsuite/
* gnat.dg/deref4.adb: New test.
* gnat.dg/deref4_pkg.ads: New helper.
gcc/ada/sem_ch4.adb
gcc/testsuite/gnat.dg/deref4.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/deref4_pkg.ads [new file with mode: 0644]