Permalink
Browse files

Allow any characters after invalid pragma warning

  • Loading branch information...
1 parent 663437c commit 222fd86dcd1932aed74b80506d7dc4130aeb525e @marek-safar marek-safar committed Sep 5, 2012
Showing with 26 additions and 0 deletions.
  1. +5 −0 mcs/mcs/cs-tokenizer.cs
  2. +11 −0 mcs/tests/test-852.cs
  3. +10 −0 mcs/tests/ver-il-net_4_5.xml
View
@@ -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
@@ -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
+}
@@ -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">

0 comments on commit 222fd86

Please sign in to comment.