Bug 15605 - invalid program not detected, RM 8.3(22), 8.5.4(6)
Summary: invalid program not detected, RM 8.3(22), 8.5.4(6)
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 3.4.0
: P2 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2004-05-23 09:31 UTC by Ludovic Brenta
Modified: 2015-12-05 09:49 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail: 4.0.0
Last reconfirmed: 2004-10-29 14:45:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic Brenta 2004-05-23 09:31:53 UTC
-- RM 8.3(22)
-- A declaration is hidden from direct visibility within the immediate
-- scope of a homograph of the declaration, if the homograph occurs
-- within an inner declarative region.
package pak1 is
  subtype list is integer;
  function f (list: integer)
       return list;  -- ERROR: subtype list is hidden by parameter

  procedure foo(x : integer);
  procedure p(foo: integer)
      renames foo;   -- ERROR: procedure foo is hidden by parameter
end pak1;



$ gcc-3.4 -c -gnatc test_244935.ads
$
Comment 1 Andrew Pinski 2004-10-29 14:45:06 UTC
Confirmed.
Comment 2 Andrew Pinski 2005-06-14 04:51:02 UTC
I think this is fixed in 4.0.0 given the following:
pak1.ads:8:15: formal parameter "list" cannot be used before end of specification
Comment 3 Arnaud Charlet 2006-11-01 20:00:31 UTC
Right, fixed.
Comment 4 Ludovic Brenta 2007-12-16 14:04:29 UTC
As of 4.2.2, only the first of the two errors is detected.  Reopening.  The second error violates 8.5.4(6): "A name that denotes a formal parameter of the subprogram_specification is not allowed within the callable_entity_name." and is not diagnosed.

GCC 4.1.2:

gnatmake -gnat05 pak1
gcc-4.1 -c -gnat05 pak1.ads
pak1.ads:8:15: formal parameter "list" cannot be used before end of specification

GCC 4.2.2:

gnatmake -gnat05 pak1
gcc-4.2 -c -gnat05 pak1.ads
pak1.ads:8:15: formal parameter "list" cannot be used before end of specification
Comment 5 Eric Botcazou 2015-12-05 09:49:57 UTC
The second error is still missing.