public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/112911] New: Problem creating aggregate constants containing a variant record
@ 2023-12-08  5:56 gaius at gcc dot gnu.org
  2023-12-08  5:56 ` [Bug modula2/112911] " gaius at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-12-08  5:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112911

            Bug ID: 112911
           Summary: Problem creating aggregate constants containing a
                    variant record
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: gaius at gcc dot gnu.org
  Target Milestone: ---

Forwarded from the gm2 mailing list:

The following code:

MODULE constvarient ;                                                           

TYPE                                                                            
   ParsedDigit = RECORD                                                         
                    CASE Valid: BOOLEAN OF                                      
                    TRUE: Value: CARDINAL;                                      
                    ELSE                                                        
                    END;                                                        
                 END;                                                           

CONST                                                                           
   PD1 = ParsedDigit { TRUE, 1 } ;                                              
   PD2 = ParsedDigit { FALSE };                                                 

VAR                                                                             
   d1, d2: ParsedDigit ;                                                        
BEGIN                                                                           
   d1 := PD1 ;                                                                  
   d2 := PD2                                                                    
END constvarient.

is rejected by gm2:

$ gm2 constvarient.mod                                                          
constvarient.mod:12:8: error: trying to construct a compound literal and using
a record field which does not exist                                             
   12 |    PD1 = ParsedDigit { TRUE, 1 } ;                                      
      |    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~                                        
constvarient.mod:13:8: error: trying to construct a compound literal and using
a record field which does not exist                                             
   13 |    PD2 = ParsedDigit { FALSE };                                         
      |    ~~~~^~~~~~~~~~~~~~~~~~~~~~~                                          
constvarient.mod:18:7: error: trying to construct a compound literal and using
a record field which does not exist                                             
   18 |    d1 := PD1 ;                                                          
      |    ~~~^~~~~~                                                            
constvarient.mod:19:7: error: trying to construct a compound literal and using
a record field which does not exist                                             
   19 |    d2 := PD2                                                            
      |    ~~~^~~~~~

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug modula2/112911] Problem creating aggregate constants containing a variant record
  2023-12-08  5:56 [Bug modula2/112911] New: Problem creating aggregate constants containing a variant record gaius at gcc dot gnu.org
@ 2023-12-08  5:56 ` gaius at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-12-08  5:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112911

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-12-08
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #1 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Conformed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-08  5:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08  5:56 [Bug modula2/112911] New: Problem creating aggregate constants containing a variant record gaius at gcc dot gnu.org
2023-12-08  5:56 ` [Bug modula2/112911] " gaius at gcc dot gnu.org

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).