r260447 - in /trunk/gcc/ada: ChangeLog einfo.ad...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Mon May 21 14:50:00 GMT 2018


Author: pmderodat
Date: Mon May 21 14:50:23 2018
New Revision: 260447

URL: https://gcc.gnu.org/viewcvs?rev=260447&root=gcc&view=rev
Log:
[Ada] Only allow Has_Discriminants on type entities

This patch enforces what the comment for Has_Discriminant says:

--    Has_Discriminants (Flag5)
--       Defined in all types and subtypes.

to avoid semantically undefined calls on non-type entities. It also adapts
other routines to respect this comment.

No user-visible impact.

2018-05-21  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* einfo.adb (Has_Discriminants): Stronger assertion.
	(Set_Has_Discriminants): Stronger assertion.
	* sem_ch13.adb (Push_Scope_And_Install_Discriminants): Adapt to respect
	the stronger assertion on Has_Discriminant.
	(Uninstall_Discriminants_And_Pop_Scope): Same as above.
	* sem_util.adb (New_Copy_Tree): Same as above.
	* sem_ch7.adb (Generate_Parent_References): Prevent calls to
	Has_Discriminant on non-type entities that might happen when the
	compiled code has errors.
	* sem_ch3.adb (Derived_Type_Declaration): Only call
	Set_Has_Discriminant on type entities.

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/einfo.adb
    trunk/gcc/ada/sem_ch13.adb
    trunk/gcc/ada/sem_ch3.adb
    trunk/gcc/ada/sem_ch7.adb
    trunk/gcc/ada/sem_util.adb



More information about the Gcc-cvs mailing list