aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_attr.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-06-02 17:22:42 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-07-05 08:28:17 +0000
commit684194f4a45e00e56687289386eea7105a762cf7 (patch)
treeef5bfa1c2f2720d256754ac11f4aa70c6d49c1e0 /gcc/ada/sem_attr.adb
parentf608cf03b1c96878d559820ccb4037fee5575876 (diff)
downloadgcc-684194f4a45e00e56687289386eea7105a762cf7.zip
gcc-684194f4a45e00e56687289386eea7105a762cf7.tar.gz
gcc-684194f4a45e00e56687289386eea7105a762cf7.tar.bz2
[Ada] Remove return statements after procedure calls that don't return
A new warning about unreachable code that follows calls to procedures with No_Return would flag many unnecessary return statements. Those returns statements were applied inconsistently, so this patch is actually more a style cleanup. gcc/ada/ * sem_attr.adb, sem_prag.adb: Remove dead return statements after calls to Error_Attr, Error_Pragma, Error_Pragma_Arg and Placement_Error. All these calls raise exceptions that are handled to gently recover from errors.
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r--gcc/ada/sem_attr.adb10
1 files changed, 0 insertions, 10 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 5bf13d1..be60087 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -1090,7 +1090,6 @@ package body Sem_Attr is
else
Error_Attr ("% attribute cannot be applied to type", P);
- return;
end if;
end if;
end if;
@@ -1429,7 +1428,6 @@ package body Sem_Attr is
else
Placement_Error;
- return;
end if;
-- 'Old attribute reference ok in a _Postconditions procedure
@@ -1445,7 +1443,6 @@ package body Sem_Attr is
else
Placement_Error;
- return;
end if;
-- Find the related subprogram subject to the aspect or pragma
@@ -1715,14 +1712,12 @@ package body Sem_Attr is
else
Placement_Error;
- return;
end if;
-- Otherwise the placement of the attribute is illegal
else
Placement_Error;
- return;
end if;
-- Find the related subprogram subject to the aspect or pragma
@@ -3666,7 +3661,6 @@ package body Sem_Attr is
else
Error_Attr ("invalid entry name", N);
- return;
end if;
for J in reverse 0 .. Scope_Stack.Last loop
@@ -3945,7 +3939,6 @@ package body Sem_Attr is
else
Error_Attr ("invalid entry family name", P);
end if;
- return;
else
Ent := Entity (Prefix (P));
@@ -3960,7 +3953,6 @@ package body Sem_Attr is
else
Error_Attr ("invalid entry name", N);
- return;
end if;
for J in reverse 0 .. Scope_Stack.Last loop
@@ -4479,7 +4471,6 @@ package body Sem_Attr is
if not Legal or else No (Spec_Id) then
Error_Attr ("attribute % must apply to entry family", P);
- return;
end if;
-- Legality checks
@@ -5898,7 +5889,6 @@ package body Sem_Attr is
elsif not Legal then
Error_Attr ("prefix of % attribute must be a function", P);
- return;
end if;
-- Attribute 'Result is part of a _Postconditions procedure. There is