Don't eat escaped U characters
authorMarek Safar <marek.safar@gmail.com>
Tue, 5 Apr 2011 11:34:05 +0000 (12:34 +0100)
committerMarek Safar <marek.safar@gmail.com>
Tue, 5 Apr 2011 11:34:39 +0000 (12:34 +0100)
mcs/errors/cs0219-5.cs [new file with mode: 0644]
mcs/errors/cs0437.cs [new file with mode: 0644]
mcs/mcs/cs-tokenizer.cs

diff --git a/mcs/errors/cs0219-5.cs b/mcs/errors/cs0219-5.cs
new file mode 100644 (file)
index 0000000..c7c63f5
--- /dev/null
@@ -0,0 +1,11 @@
+// CS0219: The variable `next' is assigned but its value is never used
+// Line: 9
+// Compiler options: -warn:3 -warnaserror
+
+class A
+{
+       public static void Main ()
+       {
+               int n\U00000065xt = 0;
+       }
+}
\ No newline at end of file
diff --git a/mcs/errors/cs0437.cs b/mcs/errors/cs0437.cs
new file mode 100644 (file)
index 0000000..b1c02c3
--- /dev/null
@@ -0,0 +1,12 @@
+// CS0437: The type `System' conflicts with the imported namespace `System'. Using the definition found in the source file
+// Line: 9
+// Compiler options: -warnaserror
+
+enum System { A }
+
+class X
+{
+       void Method (System arg)
+       {
+       }
+}
index e46780dd3e933f8c819d2d4f959c768b19eca125..8137d36f2b09cd355cbb2f3808938e035e4d1782 100644 (file)
@@ -2744,9 +2744,10 @@ namespace Mono.CSharp
                                                if (c == '\\') {
                                                        int surrogate;
                                                        c = escape (c, out surrogate);
+                                                       if (is_identifier_part_character ((char) c))
+                                                               id_builder[pos++] = (char) c;
+
                                                        if (surrogate != 0) {
-                                                               if (is_identifier_part_character ((char) c))
-                                                                       id_builder[pos++] = (char) c;
                                                                c = surrogate;
                                                        }