diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-05-22 09:24:24 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-05-22 09:24:24 +0000 |
commit | d327113612c1b089eee87f04cd517b7f7103c1ea (patch) | |
tree | 5b660c58c813d8aea1e713136d95cb2b70afe62d /gcc/testsuite/gnat.dg | |
parent | 4c24ec6d58db238f64bda456ebdb0b5c82347d78 (diff) | |
download | gcc-d327113612c1b089eee87f04cd517b7f7103c1ea.tar.gz |
sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a limited view may appear in the profile of...
* sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
limited view may appear in the profile of a function, and a call to
that function in another unit in which the full view is available must
use this full view to spurious type errors at the point of call.
* inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
of parent body with a with clause for the main unit.
* gcc-interface/decl.c (defer_limited_with_list): Document new usage.
(gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
types declared in external units like types from limited with clauses.
Adjust final processing of defer_limited_with_list accordingly.
* gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
again to translate the prefix after the field if it is incomplete.
From-SVN: r248321
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r-- | gcc/testsuite/gnat.dg/limited_with5.adb | 11 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/limited_with5.ads | 6 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/limited_with5_pkg.adb | 8 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/limited_with5_pkg.ads | 8 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/limited_with6.adb | 11 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/limited_with6.ads | 10 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/limited_with6_pkg.adb | 10 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/limited_with6_pkg.ads | 14 |
8 files changed, 78 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/limited_with5.adb b/gcc/testsuite/gnat.dg/limited_with5.adb new file mode 100644 index 00000000000..c3bf270b35e --- /dev/null +++ b/gcc/testsuite/gnat.dg/limited_with5.adb @@ -0,0 +1,11 @@ +-- { dg-do compile } +-- { dg-options "-O -gnatn -Winline" } + +package body Limited_With5 is + procedure Doit (Obj : Limited_With5_Pkg.T) is + begin + if Limited_With5_Pkg.Get_Expression_Support (Obj) > Sup_T'(100) then + raise Program_Error; + end if; + end Doit; +end Limited_With5; diff --git a/gcc/testsuite/gnat.dg/limited_with5.ads b/gcc/testsuite/gnat.dg/limited_with5.ads new file mode 100644 index 00000000000..4a242a04e11 --- /dev/null +++ b/gcc/testsuite/gnat.dg/limited_with5.ads @@ -0,0 +1,6 @@ +with Limited_With5_Pkg; + +package Limited_With5 is + type Sup_T is new Integer; + procedure Doit (Obj : Limited_With5_Pkg.T); +end Limited_With5; diff --git a/gcc/testsuite/gnat.dg/limited_with5_pkg.adb b/gcc/testsuite/gnat.dg/limited_with5_pkg.adb new file mode 100644 index 00000000000..785f84e91fd --- /dev/null +++ b/gcc/testsuite/gnat.dg/limited_with5_pkg.adb @@ -0,0 +1,8 @@ +with Limited_With5; + +package body Limited_With5_Pkg is + function Get_Expression_Support (Obj : T) return Limited_With5.Sup_T is + begin + return Limited_With5.Sup_T (Obj + 1); + end Get_Expression_Support; +end Limited_With5_Pkg; diff --git a/gcc/testsuite/gnat.dg/limited_with5_pkg.ads b/gcc/testsuite/gnat.dg/limited_with5_pkg.ads new file mode 100644 index 00000000000..e048653a873 --- /dev/null +++ b/gcc/testsuite/gnat.dg/limited_with5_pkg.ads @@ -0,0 +1,8 @@ +limited with Limited_With5; + +package Limited_With5_Pkg is + type T is limited private; + function Get_Expression_Support (Obj : T) return Limited_With5.Sup_T with Inline; +private + type T is new Integer; +end Limited_With5_Pkg; diff --git a/gcc/testsuite/gnat.dg/limited_with6.adb b/gcc/testsuite/gnat.dg/limited_with6.adb new file mode 100644 index 00000000000..972b47231e8 --- /dev/null +++ b/gcc/testsuite/gnat.dg/limited_with6.adb @@ -0,0 +1,11 @@ +-- { dg-do compile } +-- { dg-options "-O -gnatn -Winline" } + +package body Limited_With6 is + procedure Doit (Obj : Limited_With6_Pkg.T) is + begin + if Limited_With6_Pkg.Get_Expression_Support (Obj) > Sup_T'(100) then + raise Program_Error; + end if; + end Doit; +end Limited_With6; diff --git a/gcc/testsuite/gnat.dg/limited_with6.ads b/gcc/testsuite/gnat.dg/limited_with6.ads new file mode 100644 index 00000000000..05b9cc9fa40 --- /dev/null +++ b/gcc/testsuite/gnat.dg/limited_with6.ads @@ -0,0 +1,10 @@ +with Limited_With6_Pkg; + +package Limited_With6 is + type Sup_T is new Integer; + procedure Doit (Obj : Limited_With6_Pkg.T); + + type Rec is record + A : Limited_With6_Pkg.Taft_Ptr; + end record; +end Limited_With6; diff --git a/gcc/testsuite/gnat.dg/limited_with6_pkg.adb b/gcc/testsuite/gnat.dg/limited_with6_pkg.adb new file mode 100644 index 00000000000..46db471446b --- /dev/null +++ b/gcc/testsuite/gnat.dg/limited_with6_pkg.adb @@ -0,0 +1,10 @@ +with Limited_With6; + +package body Limited_With6_Pkg is + function Get_Expression_Support (Obj : T) return Limited_With6.Sup_T is + begin + return Limited_With6.Sup_T (Obj + 1); + end Get_Expression_Support; + + type TT is access all Limited_With6.Rec; +end Limited_With6_Pkg; diff --git a/gcc/testsuite/gnat.dg/limited_with6_pkg.ads b/gcc/testsuite/gnat.dg/limited_with6_pkg.ads new file mode 100644 index 00000000000..4eab8682635 --- /dev/null +++ b/gcc/testsuite/gnat.dg/limited_with6_pkg.ads @@ -0,0 +1,14 @@ +limited with Limited_With6; + +package Limited_With6_Pkg is + type T is limited private; + function Get_Expression_Support (Obj : T) return Limited_With6.Sup_T with Inline; + + type Taft_Ptr is private; + +private + type T is new Integer; + + type TT; + type Taft_Ptr is access TT; +end Limited_With6_Pkg; |