Bug 18454

Summary: Illegal program not detected, RM 10.1.5(4), 8.1(16)
Product: gcc Reporter: Ludovic Brenta <ludovic>
Component: adaAssignee: Not yet assigned to anyone <unassigned>
Status: NEW ---    
Severity: minor CC: ebotcazou, gcc-bugs, nicolas
Priority: P2 Keywords: accepts-invalid
Version: 3.4.2   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2005-06-14 20:45:10

Description Ludovic Brenta 2004-11-12 16:37:13 UTC
(Debian bug #280939)

--  RM 10.1.5(4) "the pragma shall have an argument that is a name
--  denoting that declaration."
--  RM 8.1(16) "The children of a parent library unit are inside the
--  parent's declarative region."

package pak1 is
   pragma Pure;
end pak1;

procedure pak1.p2;
pragma Pure (p2);          -- ERROR: need expanded name
pragma Import (ada, p2);   -- ERROR: need expanded name
pragma Inline (p2);        -- ERROR: need expanded name

with Pak1.P2;
procedure Test_130 is
begin
   Pak1.P2;
end Test_130;


Expected output all three errors diagnosed:
pak1-p2.ads:3:13: "p2" is not directly visible
pak1-p2.ads:4:20: "p2" is not directly visible
pak1-p2.ads:5:15: "p2" is not directly visible


Actual output: the compiler says nothing, the linker, as expected,
can't find pak1.p2:

./test_130.o(.text+0x4): In function `_ada_test_130':
: undefined reference to `p2'
gnatlink: cannot call /usr/bin/gnatgcc
gnatmake: *** link failed.
Comment 1 Andrew Pinski 2004-11-24 21:12:30 UTC
Confirmed.
Comment 2 Nicolas Boulenguez 2011-08-31 14:00:40 UTC
found 4.6.1
Comment 3 Nicolas Boulenguez 2014-02-27 18:49:12 UTC
Found in 4.9-20140218
Comment 4 Eric Botcazou 2015-12-05 11:00:27 UTC
The error is still missing.