diff options
author | Ed Schonberg <schonberg@adacore.com> | 2021-05-29 10:14:46 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-07-08 13:34:22 +0000 |
commit | 99d6c1f8c29da41c33059024ff7494834b3bfbdc (patch) | |
tree | 8a581b853a32981a24558dea81f2a17830c570f8 | |
parent | 3c18e32037a4ab02afd22a535a96ac4cc3f88b16 (diff) | |
download | gcc-99d6c1f8c29da41c33059024ff7494834b3bfbdc.zip gcc-99d6c1f8c29da41c33059024ff7494834b3bfbdc.tar.gz gcc-99d6c1f8c29da41c33059024ff7494834b3bfbdc.tar.bz2 |
[Ada] Spurious style message on missing overriding indicator
gcc/ada/
* style.adb (Missing_Overriding): Do not emit message when
parent of subprogram is a full type declaration.
-rw-r--r-- | gcc/ada/style.adb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/style.adb b/gcc/ada/style.adb index 1409cc6..c2bff83 100644 --- a/gcc/ada/style.adb +++ b/gcc/ada/style.adb @@ -265,11 +265,15 @@ package body Style is -- indicators were introduced in Ada 2005. We apply Comes_From_Source -- to Original_Node to catch the case of a procedure body declared with -- "is null" that has been rewritten as a normal empty body. + -- We do not emit a warning on an inherited operation that comes from + -- a type derivation. if Style_Check_Missing_Overriding and then (Comes_From_Source (Original_Node (N)) or else Is_Generic_Instance (E)) and then Ada_Version_Explicit >= Ada_2005 + and then Present (Parent (E)) + and then Nkind (Parent (E)) /= N_Full_Type_Declaration then -- If the subprogram is an instantiation, its declaration appears -- within a wrapper package that precedes the instance node. Place |