aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2022-10-17 11:56:27 -0400
committerMarc Poulhiès <poulhies@adacore.com>2022-11-07 09:36:35 +0100
commit2702882fdbd14ad647ea2a88c7f9ea2cd62fa23e (patch)
tree6f87bf0c0fb3ca2e3f67ad5d6c54f7fef7d6e2fc /libgo
parent9b07c1752b9bf49143a41c810e2db86f633fdb1c (diff)
downloadgcc-2702882fdbd14ad647ea2a88c7f9ea2cd62fa23e.zip
gcc-2702882fdbd14ad647ea2a88c7f9ea2cd62fa23e.tar.gz
gcc-2702882fdbd14ad647ea2a88c7f9ea2cd62fa23e.tar.bz2
ada: New warning about noncomposing user-defined "="
Print warning for a user-defined "=" that does not compose as might be expected (i.e. is ignored for predefined "=" of a containing record or array type). This warning is enabled by -gnatw_q; we don't enable it by default because it generates too many false positives. We also don't enable it via -gnatwa. gcc/ada/ * exp_ch4.adb (Expand_Array_Equality): Do not test Ltyp = Rtyp here, because that is necessarily true. Move assertion thereof to more general place. (Expand_Composite_Equality): Pass in Outer_Type, for use in warnings. Rename Typ to be Comp_Type, to more clearly distinguish it from Outer_Type. Print warning when appropriate. * exp_ch4.ads: Minor comment fix. * errout.ads: There is no such pragma as Warning_As_Pragma -- Warning_As_Error must have been intended. Improve comment for ?x?. * exp_ch3.adb (Build_Untagged_Equality): Update comment to be accurate for more recent versions of Ada. * sem_case.adb (Choice_Analysis): Declare user-defined "=" functions as abstract. * sem_util.ads (Is_Bounded_String): Give RM reference in comment. * warnsw.ads, warnsw.adb (Warn_On_Ignored_Equality): Implement new warning switch -gnatw_q. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Document new warning switch. * gnat_ugn.texi: Regenerate.
Diffstat (limited to 'libgo')
0 files changed, 0 insertions, 0 deletions