public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/15603] New: Illegal program not detected, 12.7(10) (generic parameter is visible, shouldn't be)
@ 2004-05-23 23:33 ludovic dot brenta at insalien dot org
  2004-05-24  1:03 ` [Bug ada/15603] " pinskia at gcc dot gnu dot org
  2004-10-31 19:43 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: ludovic dot brenta at insalien dot org @ 2004-05-23 23:33 UTC (permalink / raw)
  To: gcc-bugs

GNAT compiles the following illegal program.

generic
package P1 is
end P1;

with P1;
generic
   with package the_P1 is new P1; -- [1]
package P2 is
end P2;

with P1;
package new_P1 is new P1;

with new_P1, P2;
package P3 is
   package new_P2 is new P2(new_P1);
   package my_P1 renames new_P2.the_P1;   -- ERROR: the_P1 is not visible
end P3;

$ gnatchop -w p; gnatmake p3
splitting p into:
   p1.ads
   p2.ads
   new_p1.ads
   p3.ads
gcc -c p3.ads
gcc -c new_p1.ads
gcc -c p2.ads
gcc -c p1.ads

Compilation finished at Wed Apr 14 19:11:19

12.7(10):
"The visible part of a formal package includes the first list of
basic_declarative_items of the package_specification. In addition, if
the formal_package_actual_part is (<>), it also includes the
generic_formal_part of the template for the formal package."

Here, the formal_package_actual_part at line [1] is not (<>),
therefore the_P1 is not part of P2's visible part.  Here is an example
where gnat correctly applies this rule:

generic
   i: integer;
package P2 is
end P2;

with P2;
package P3 is
   package new_P2 is new P2(3);
   x: integer renames new_P2.i;
end P3;

$ gnatchop -w p; gnatmake p3
splitting p into:
   p2.ads
   p3.ads
gcc -c p3.ads
p3.ads:5:29: "i" is not a visible entity of "new_P2"
gnatmake: "p3.ads" compilation error

-- 
           Summary: Illegal program not detected, 12.7(10) (generic
                    parameter is visible, shouldn't be)
           Product: gcc
           Version: 3.4.0
            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
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug ada/15603] Illegal program not detected, 12.7(10) (generic parameter is visible, shouldn't be)
  2004-05-23 23:33 [Bug ada/15603] New: Illegal program not detected, 12.7(10) (generic parameter is visible, shouldn't be) ludovic dot brenta at insalien dot org
@ 2004-05-24  1:03 ` pinskia at gcc dot gnu dot org
  2004-10-31 19:43 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-24  1:03 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid


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


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

* [Bug ada/15603] Illegal program not detected, 12.7(10) (generic parameter is visible, shouldn't be)
  2004-05-23 23:33 [Bug ada/15603] New: Illegal program not detected, 12.7(10) (generic parameter is visible, shouldn't be) ludovic dot brenta at insalien dot org
  2004-05-24  1:03 ` [Bug ada/15603] " pinskia at gcc dot gnu dot org
@ 2004-10-31 19:43 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-31 19:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-31 19:43 -------
Fixed on the mainline:
p3.ads:4:32: "the_P1" is not a visible entity of "new_P2"


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2004-10-31 19:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-23 23:33 [Bug ada/15603] New: Illegal program not detected, 12.7(10) (generic parameter is visible, shouldn't be) ludovic dot brenta at insalien dot org
2004-05-24  1:03 ` [Bug ada/15603] " pinskia at gcc dot gnu dot org
2004-10-31 19:43 ` 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).