summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-22 07:03:30 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-22 07:03:30 +0000
commit3c71ed7c133c1becd1551dc2dae8e24d3b841116 (patch)
tree584d7085a6f336711ab6bd6de33303e3dcb54b19 /gcc/ada/sem_util.adb
parentfc6904132d230cb546e3e9dd8cd987bb55ab39c8 (diff)
downloadgcc-3c71ed7c133c1becd1551dc2dae8e24d3b841116.tar.gz
2010-06-22 Thomas Quinot <quinot@adacore.com>
* sem_eval.adb (Find_Universal_Operator_Type): New subprogram to identify the operand type of an operator on universal operands, when an explicit scope indication is present. Diagnose the case where such a call is ambiguous. (Eval_Arithmetic_Op, Eval_Relational_Op, Eval_Unary_Op): Use the above to identify the operand type so it can be properly frozen. * sem_res.adb (Make_Call_Into_Operator): Remove bogus freeze of operand type, done in an arbitrary, possibly incorrect type (the presence of some numeric type in the scope is checked for legality, but when more than one such type is in the scope, we just pick a random one, not necessarily the expected one). * sem_utils.ads, sem_utils.adb (Is_Universal_Numeric_Type): New utility subprogram. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161134 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r--gcc/ada/sem_util.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 583135eee54..340e8fee07f 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -7082,6 +7082,15 @@ package body Sem_Util is
return (U /= 0);
end Is_True;
+ -------------------------------
+ -- Is_Universal_Numeric_Type --
+ -------------------------------
+
+ function Is_Universal_Numeric_Type (T : Entity_Id) return Boolean is
+ begin
+ return T = Universal_Integer or else T = Universal_Real;
+ end Is_Universal_Numeric_Type;
+
-------------------
-- Is_Value_Type --
-------------------