diff options
author | Arnaud Charlet <charlet@adacore.com> | 2020-06-03 03:42:19 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-07-15 09:42:50 -0400 |
commit | 00847335c80917e731f2999bf447319290c70718 (patch) | |
tree | ac38666067d91c751ac66440ffd3425d7259f5c2 | |
parent | 7fe05755eb49f2fd34ce0fe725978c7fadef8ee3 (diff) | |
download | gcc-00847335c80917e731f2999bf447319290c70718.zip gcc-00847335c80917e731f2999bf447319290c70718.tar.gz gcc-00847335c80917e731f2999bf447319290c70718.tar.bz2 |
[Ada] Missing error on operator call
gcc/ada/
* sem_ch6.adb (Analyze_Procedure_Call): Detect use of operators
in a procedure call.
* sem_util.adb: Minor edit.
-rw-r--r-- | gcc/ada/sem_ch6.adb | 4 | ||||
-rw-r--r-- | gcc/ada/sem_util.adb | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 6651671..11e496a 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -2014,6 +2014,10 @@ package body Sem_Ch6 is and then Comes_From_Source (N) then Error_Msg_N ("missing explicit dereference in call", N); + + elsif Ekind (Entity (P)) = E_Operator then + Error_Msg_Name_1 := Chars (P); + Error_Msg_N ("operator % cannot be used as a procedure", N); end if; Analyze_Call_And_Resolve; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 93447cc..480e6f1 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -28605,12 +28605,12 @@ package body Sem_Util is then return; - -- In an instance, there is an ongoing problem with completion of + -- In an instance, there is an ongoing problem with completion of -- types derived from private types. Their structure is what Gigi - -- expects, but the Etype is the parent type rather than the - -- derived private type itself. Do not flag error in this case. The - -- private completion is an entity without a parent, like an Itype. - -- Similarly, full and partial views may be incorrect in the instance. + -- expects, but the Etype is the parent type rather than the derived + -- private type itself. Do not flag error in this case. The private + -- completion is an entity without a parent, like an Itype. Similarly, + -- full and partial views may be incorrect in the instance. -- There is no simple way to insure that it is consistent ??? -- A similar view discrepancy can happen in an inlined body, for the |