Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow any characters after invalid pragma warning

  • Loading branch information...
commit 222fd86dcd1932aed74b80506d7dc4130aeb525e 1 parent 663437c
@marek-safar marek-safar authored
View
5 mcs/mcs/cs-tokenizer.cs
@@ -2421,6 +2421,11 @@ void ParsePragmaDirective (string arg)
}
Report.Warning (1634, 1, Location, "Expected disable or restore");
+
+ // Eat any remaining characters on the line
+ while (c != '\n' && c != -1)
+ c = get_char ();
+
return;
}
View
11 mcs/tests/test-852.cs
@@ -0,0 +1,11 @@
+// Compiler options: -warnaserror
+
+public class Test
+{
+#pragma warning disable 1634
+#pragma warning suppress 56500
+ public static void Main ()
+ {
+ }
+#pragma warning restore 1634
+}
View
10 mcs/tests/ver-il-net_4_5.xml
@@ -46009,6 +46009,16 @@
</method>
</type>
</test>
+ <test name="test-852.cs">
+ <type name="Test">
+ <method name="Void Main()" attrs="150">
+ <size>2</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-86.cs">
<type name="T.T">
<method name="Int32 method1(System.Type, Int32)" attrs="145">
Please sign in to comment.
Something went wrong with that request. Please try again.