projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
895cf05
)
[Ada] Reject illegal bodies for null procedures
author
Ghjuvan Lacambre
<lacambre@adacore.com>
Mon, 2 Mar 2020 11:41:52 +0000
(12:41 +0100)
committer
Pierre-Marie de Rodat
<derodat@adacore.com>
Wed, 10 Jun 2020 13:34:55 +0000
(09:34 -0400)
2020-06-10 Ghjuvan Lacambre <lacambre@adacore.com>
gcc/ada/
* par-ch6.adb (P_Subprogram): Reject duplicate subprogram
declarations.
gcc/ada/par-ch6.adb
patch
|
blob
|
history
diff --git
a/gcc/ada/par-ch6.adb
b/gcc/ada/par-ch6.adb
index 2cc3f08f94a27103e3f6094694afb1cc5c68615b..a43d6735668e7184e43a7d8fb0c2f5b113011682 100644
(file)
--- a/
gcc/ada/par-ch6.adb
+++ b/
gcc/ada/par-ch6.adb
@@
-959,6
+959,13
@@
package body Ch6 is
-- the collected aspects, if any, to the body.
if Token = Tok_Is then
+
+ -- If the subprogram declaration already has a specification, we
+ -- can't define another.
+ if Null_Present (Specification (Decl_Node)) then
+ Error_Msg_AP ("null procedure cannot have a body");
+ end if;
+
Scan;
goto Subprogram_Body;