public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-185] [Ada] Fix check for looking for user defined literals
@ 2022-05-09  9:31 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-09  9:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f1231d9a0baab25e0a07b0d6146b91e59ecfadb8

commit r13-185-gf1231d9a0baab25e0a07b0d6146b91e59ecfadb8
Author: Ed Schonberg <schonberg@adacore.com>
Date:   Tue Dec 14 15:44:16 2021 +0100

    [Ada] Fix check for looking for user defined literals
    
    Recall that Has_Possible_Literal_Aspects only comes in if a given node
    does not have any visible interpretation. If one operand is a literal we
    assume that there may be a user-defined literal defined for some type to
    be determined during the downward pass of resolution, but that depends
    on the existence of some user-defined function or operator that can take
    that literal as an actual. If analysis did not find such, the call is
    illegal. I think that the following must be added to Operator_Check to
    recover the proper error.
    
    Note that this breaks current partial implementation of user-defined
    literals.
    
    gcc/ada/
    
            * sem_ch4.adb (Operator_Check): Fix condition.

Diff:
---
 gcc/ada/sem_ch4.adb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 68839b31345..915a7b48eca 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -7260,7 +7260,9 @@ package body Sem_Ch4 is
             then
                return;
 
-            elsif Has_Possible_Literal_Aspects (N) then
+            elsif Present (Entity (N))
+              and then Has_Possible_Literal_Aspects (N)
+            then
                return;
 
             --  If we have a logical operator, one of whose operands is


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-09  9:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09  9:31 [gcc r13-185] [Ada] Fix check for looking for user defined literals Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).