re PR ada/32792 (Assert_Failure sinfo.adb:1730)

gcc/ada/
	PR ada/32792
	* sem_attr.adb (Analyze_Attribute, Attribute_Integer_Value clause):
	Signal an error when attribute argument is a fixed-point value of
	an unknown type.

    gcc/testsuite/
	PR ada/32792
	* gnat.dg/specs/integer_value.ads: New test.

From-SVN: r130497
This commit is contained in:
Samuel Tardieu 2007-11-28 20:46:18 +00:00 committed by Samuel Tardieu
parent 9c5a3a8d78
commit 5a21849883
4 changed files with 22 additions and 0 deletions

View file

@ -17,6 +17,11 @@
* snames.ads (Attribute_Class_Array): Moved from sem-attr.ads.
PR ada/32792
* sem_attr.adb (Analyze_Attribute, Attribute_Integer_Value clause):
Signal an error when attribute argument is a fixed-point value of
an unknown type.
2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
PR 34081/C++

View file

@ -2975,6 +2975,15 @@ package body Sem_Attr is
Check_E1;
Check_Integer_Type;
Resolve (E1, Any_Fixed);
-- Signal an error if argument type is not a specific fixed-point
-- subtype. An error has been signalled already if the argument
-- was not of a fixed-point type.
if Etype (E1) = Any_Fixed and then not Error_Posted (E1) then
Error_Attr ("argument of % must be of a fixed-point type", E1);
end if;
Set_Etype (N, P_Base_Type);
-----------

View file

@ -6,6 +6,9 @@
PR ada/17317
* gnat.dg/specs/attribute_parsing.ads: New test.
PR ada/32792
* gnat.dg/specs/integer_value.ads: New test.
2007-11-28 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/34140

View file

@ -0,0 +1,5 @@
-- { dg-do compile }
package Integer_Value is
X : constant Integer :=
Integer'Integer_Value (12.8); -- { dg-error "fixed-point type" "" }
end Integer_Value;