public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/17953] New: Illegal program not detected, RM 3.9.2(9)
@ 2004-10-12 18:50 ludovic dot brenta at insalien dot org
  2004-11-01  1:38 ` [Bug ada/17953] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: ludovic dot brenta at insalien dot org @ 2004-10-12 18:50 UTC (permalink / raw)
  To: gcc-bugs

Debian Bug #276224:

--  If the expected type for an expression or name is some specific
--  tagged type, then the expression or name shall not be dynamically
--  tagged unless it is a controlling operand in a call on a
--  dispatching operation.
procedure Test_121 is
   package pak1 is
      type T1 is tagged null record;
      function f1 (x1: T1) return T1;
   end pak1;

   package body pak1 is
      function f1 (x1: T1) return T1 is
      begin
         return x1;
      end;
   end pak1;
   use pak1;

   type T2 is record
      a1: T1;
   end record;

   z0: T1'class := T1'(null record);
   z1: T1 := f1(z0);           -- ERROR: gnat correctly rejects
   z2: T2 := (a1 => f1(z0));   -- ERROR: gnat mistakenly allows
begin
   null;
end Test_121;


The output is:

test_121.adb:24:14: dynamically tagged expression not allowed
gnatmake: "test_121.adb" compilation error


The second error is not detected.

-- 
           Summary: Illegal program not detected, RM 3.9.2(9)
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ludovic dot brenta at insalien dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17953


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

* [Bug ada/17953] Illegal program not detected, RM 3.9.2(9)
  2004-10-12 18:50 [Bug ada/17953] New: Illegal program not detected, RM 3.9.2(9) ludovic dot brenta at insalien dot org
@ 2004-11-01  1:38 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-01  1:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-01 01:38 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |accepts-invalid
      Known to fail|                            |4.0.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-11-01 01:38:56
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17953


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

end of thread, other threads:[~2004-11-01  1:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-12 18:50 [Bug ada/17953] New: Illegal program not detected, RM 3.9.2(9) ludovic dot brenta at insalien dot org
2004-11-01  1:38 ` [Bug ada/17953] " pinskia at gcc dot gnu dot 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).