c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / gnat.dg / strub_ind2.adb
blobb9bfe50e9296e5b0516556423a486b761060f983
1 -- { dg-do compile }
2 -- { dg-options "-fstrub=strict" }
3 -- { dg-require-effective-target strub }
5 -- This is essentially the same test as strub_attr.adb,
6 -- but with an explicit conversion.
8 package body Strub_Ind2 is
9 E : exception;
11 function G return Integer;
12 pragma Machine_Attribute (G, "strub", "callable");
14 procedure P (X : Integer) is
15 begin
16 raise E;
17 end;
19 function G return Integer is (FP (X));
21 type GT is access function return Integer;
22 pragma Machine_Attribute (GT, "strub", "callable");
24 type GT_SD is access function return Integer;
25 pragma Machine_Attribute (GT_SD, "strub", "disabled");
27 GP : GT_SD := GT_SD (GT'(G'Access));
28 -- pragma Machine_Attribute (GP, "strub", "disabled"); -- not needed.
30 function F (X : Integer) return Integer is
31 begin
32 return X * GP.all; -- { dg-error "using non-.strub. type" }
33 end;
35 end Strub_Ind2;