[gcc r16-6607] ada: Spurious warning on untagged record type equality
Marc Poulhies
dkm@gcc.gnu.org
Fri Jan 9 11:01:08 GMT 2026
https://gcc.gnu.org/g:3e26e2677c0085b7db2d269fd2839d55dab3300c
commit r16-6607-g3e26e2677c0085b7db2d269fd2839d55dab3300c
Author: Javier Miranda <miranda@adacore.com>
Date: Thu Nov 27 17:56:08 2025 +0000
ada: Spurious warning on untagged record type equality
The frontend reports a spurious warning when the type of some
component of an untagged record type is a private record type
that has an user-defined equality operator and the sources
are compiled enabling warnings for ignored equality operators
(that is, switch -gnatdw_q).
The warning is spurious because it must not be reported when
the full type declaration of the private type is a record type.
gcc/ada/ChangeLog:
* exp_ch3.adb (Build_Untagged_Record_Equality): Add missing
support for incomplete and private types.
Diff:
---
gcc/ada/exp_ch3.adb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index 57d2ec399745..1b53199cb4e2 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -5180,7 +5180,7 @@ package body Exp_Ch3 is
while Present (Comp) loop
if Present (User_Defined_Eq (Etype (Comp)))
- and then not Is_Record_Type (Etype (Comp))
+ and then not Is_Record_Type (Underlying_Type (Etype (Comp)))
and then not Is_Intrinsic_Subprogram
(User_Defined_Eq (Etype (Comp)))
then
More information about the Gcc-cvs
mailing list