diff options
author | Ed Schonberg <schonberg@adacore.com> | 2019-12-12 10:03:53 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-12-12 10:03:53 +0000 |
commit | 8d9cf0a3b3e5629be6ff87f0db8232867555ece8 (patch) | |
tree | 46f20de138cb02c9b0eac3cbf1382c7bc877cb66 /gcc/ada | |
parent | 4dd8320fbb787527b417ba7e69ae3786b511e813 (diff) | |
download | gcc-8d9cf0a3b3e5629be6ff87f0db8232867555ece8.zip gcc-8d9cf0a3b3e5629be6ff87f0db8232867555ece8.tar.gz gcc-8d9cf0a3b3e5629be6ff87f0db8232867555ece8.tar.bz2 |
[Ada] Spurious warning about change of representastion in call
2019-12-12 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch13.adb (Same_Reprewentation): if the actual in a call is
a generic actual type, use its bsae type to determine whether a
change of representastion may be necessary for proper parameter
passing.
From-SVN: r279305
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/sem_ch13.adb | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f18df82..3423e2e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,12 @@ 2019-12-12 Ed Schonberg <schonberg@adacore.com> + * sem_ch13.adb (Same_Reprewentation): if the actual in a call is + a generic actual type, use its bsae type to determine whether a + change of representastion may be necessary for proper parameter + passing. + +2019-12-12 Ed Schonberg <schonberg@adacore.com> + * sem_type.adb (Find_Unique_Type): A call to the universal access equality operator requires one operand to be a universal access, and the other to be an access type. There is no diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 759b7ce..b6d9705 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -13448,6 +13448,14 @@ package body Sem_Ch13 is and then Base_Type (T1) = Full_View (Base_Type (T2)) then return True; + + -- If T2 is a generic actual it is declared as a subtype, so + -- check against its base type. + + elsif Is_Generic_Actual_Type (T1) + and then Same_Representation (Base_Type (T1), T2) + then + return True; end if; -- Tagged types always have the same representation, because it is not |