r256504 - in /trunk/gcc: ada/ChangeLog ada/sem_...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Thu Jan 11 08:52:00 GMT 2018


Author: pmderodat
Date: Thu Jan 11 08:52:51 2018
New Revision: 256504

URL: https://gcc.gnu.org/viewcvs?rev=256504&root=gcc&view=rev
Log:
[Ada] Warning on use of predefined operations on an actual fixed-point type

The compiler warns when a generic actual is a fixed-point type, because
arithmetic operations in the instance will use the predefined operations on
it, even if the type has user-defined primitive operations (unless formsl
surprograms for these operations appear in the generic). This patch refines
this warning to exclude the case where the formsal type is private, because
in this case there can be no suspicious arithmetic operastions in the generic
unit.

2018-01-11  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch12.adb (Check_Fixed_Point_Type): Do not apply check if the
	formsl type corresponding to the actual fixed point type is private,
	because in this case there can be no suspicious arithmetic operations
	in the generic unless they reference a formal subprogram.  Clarify
	warning.

gcc/testsuite/

	* gnat.dg/fixedpnt2.adb, gnat.dg/fixedpnt2.ads: New testcase.

Added:
    trunk/gcc/testsuite/gnat.dg/fixedpnt2.adb
    trunk/gcc/testsuite/gnat.dg/fixedpnt2.ads
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/sem_ch12.adb
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list