Merge pull request #5082 from kumpera/fix-ro-fs-file-delete
[mono.git] / mcs / mcs / report.cs
index 009007b0d529ca45d1cc0de85de61a5cb4f1dab8..f73bed2b0b0d6b342ceb69dcc362bc54e06adf8e 100644 (file)
@@ -56,15 +56,15 @@ namespace Mono.CSharp {
                        3000, 3001, 3002, 3003, 3005, 3006, 3007, 3008, 3009,
                        3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019,
                        3021, 3022, 3023, 3024, 3026, 3027,
-                       4014
+                       4014, 4024, 4025, 4026,
+                       7035, 7080, 7081, 7082, 7095,
+                       8009, 8094
                };
 
-               static HashSet<int> AllWarningsHashSet;
-
                public Report (CompilerContext context, ReportPrinter printer)
                {
                        if (context == null)
-                               throw new ArgumentNullException ("settings");
+                               throw new ArgumentNullException ("context");
                        if (printer == null)
                                throw new ArgumentNullException ("printer");
 
@@ -101,6 +101,12 @@ namespace Mono.CSharp {
                        case LanguageVersion.V_5:
                                version = "5.0";
                                break;
+                       case LanguageVersion.V_6:
+                               version = "6.0";
+                               break;
+                       case LanguageVersion.V_7:
+                               version = "7.0";
+                               break;
                        default:
                                throw new InternalErrorException ("Invalid feature version", compiler.Settings.Version);
                        }
@@ -170,18 +176,6 @@ namespace Mono.CSharp {
                        extra_information.Add (msg);
                }
 
-               public bool CheckWarningCode (int code, Location loc)
-               {
-                       if (AllWarningsHashSet == null)
-                               AllWarningsHashSet = new HashSet<int> (AllWarnings);
-
-                       if (AllWarningsHashSet.Contains (code))
-                               return true;
-
-                       Warning (1691, 1, loc, "`{0}' is not a valid warning number", code);
-                       return false;
-               }
-
                public void ExtraInformation (Location loc, string msg)
                {
                        extra_information.Add (String.Format ("{0} {1}", loc, msg));
@@ -1104,8 +1098,7 @@ namespace Mono.CSharp {
 
                public void WarningDisable (Location location, int code, Report Report)
                {
-                       if (Report.CheckWarningCode (code, location))
-                               regions.Add (new Disable (location.Row, code));
+                       regions.Add (new Disable (location.Row, code));
                }
 
                public void WarningEnable (int line)
@@ -1115,9 +1108,6 @@ namespace Mono.CSharp {
 
                public void WarningEnable (Location location, int code, CompilerContext context)
                {
-                       if (!context.Report.CheckWarningCode (code, location))
-                               return;
-
                        if (context.Settings.IsWarningDisabledGlobally (code))
                                context.Report.Warning (1635, 1, location, "Cannot restore warning `CS{0:0000}' because it was disabled globally", code);