diff options
author | Steve Baird <baird@adacore.com> | 2022-08-30 16:04:02 -0700 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-09-12 10:16:51 +0200 |
commit | d917a68d6e4583e634557d651194d1abea850b61 (patch) | |
tree | 9e62c9b5091d0dc56b756ba808924cb0f0cd1b95 /gcc/ada/contracts.adb | |
parent | 4a7312f7ce189783a2cb5318bdcf50e8148b909d (diff) | |
download | gcc-d917a68d6e4583e634557d651194d1abea850b61.zip gcc-d917a68d6e4583e634557d651194d1abea850b61.tar.gz gcc-d917a68d6e4583e634557d651194d1abea850b61.tar.bz2 |
[Ada] Internal error compiling formal instance of generic with Initial_Condition
Prevent the compiler from failing with an internal error in some cases involving
an instance of a generic which takes as a formal parameter an instance of a
second generic, where the second generic has an Initial_Condition aspect
specification.
gcc/ada/
* contracts.adb
(Analyze_Package_Contract): Do not analyze the contract of a
temporary package created just to check conformance of an actual
package.
Diffstat (limited to 'gcc/ada/contracts.adb')
-rw-r--r-- | gcc/ada/contracts.adb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb index 3f85ebc9..46c9511 100644 --- a/gcc/ada/contracts.adb +++ b/gcc/ada/contracts.adb @@ -1319,6 +1319,18 @@ package body Contracts is if Present (Items) then if Analyzed (Items) then return; + + -- Do not analyze the contract of the internal package + -- created to check conformance of an actual package. + -- Such an internal package is removed from the tree after + -- legality checks are completed, and it does not contain + -- the declarations of all local entities of the generic. + + elsif Is_Internal (Pack_Id) + and then Is_Generic_Instance (Pack_Id) + then + return; + else Set_Analyzed (Items); end if; |