summaryrefslogtreecommitdiff
path: root/gcc/ada/stylesw.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-20 15:43:11 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-20 15:43:11 +0000
commitd39cadc692de4139b1cfaa05aa5fa4f1c713bba1 (patch)
treedb110bbbc9ab65618b70d615e6c675b9d6248c05 /gcc/ada/stylesw.adb
parentf52767ac36185f976afd0875bd1c95808418c8cf (diff)
downloadgcc-d39cadc692de4139b1cfaa05aa5fa4f1c713bba1.tar.gz
2008-08-20 Ed Schonberg <schonberg@adacore.com>
* styleg-c.ads, styleg-c.adb (Missing_Overriding): new procedure to implement style check that overriding operations are explicitly marked at such. * style.ads (Missing_Overriding): new procedure that provides interface to previous one. * stylesw.ads, stylesw.adb: New style switch -gnatyO, to enable check that the declaration or body of overriding operations carries an explicit overriding indicator. * sem_ch8.adb (Analyze_Subprogram_Renaming): if operation is overriding, check whether explicit indicator should be present. * sem_ch6.adb (Verify_Overriding_Indicator, Check_Overriding_Indicator): If operation is overriding, check whether declaration and/or body of subprogram should be present git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139316 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/stylesw.adb')
-rw-r--r--gcc/ada/stylesw.adb5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/stylesw.adb b/gcc/ada/stylesw.adb
index 34688df9c32..764d9af80e9 100644
--- a/gcc/ada/stylesw.adb
+++ b/gcc/ada/stylesw.adb
@@ -49,6 +49,7 @@ package body Stylesw is
Style_Check_Layout := False;
Style_Check_Max_Line_Length := False;
Style_Check_Max_Nesting_Level := False;
+ Style_Check_Missing_Overriding := False;
Style_Check_Mode_In := False;
Style_Check_Order_Subprograms := False;
Style_Check_Pragma_Casing := False;
@@ -123,6 +124,7 @@ package body Stylesw is
Add ('l', Style_Check_Layout);
Add ('n', Style_Check_Standard);
Add ('o', Style_Check_Order_Subprograms);
+ Add ('O', Style_Check_Missing_Overriding);
Add ('p', Style_Check_Pragma_Casing);
Add ('r', Style_Check_References);
Add ('s', Style_Check_Specs);
@@ -370,6 +372,9 @@ package body Stylesw is
when 'o' =>
Style_Check_Order_Subprograms := True;
+ when 'O' =>
+ Style_Check_Missing_Overriding := True;
+
when 'p' =>
Style_Check_Pragma_Casing := True;