]> Cypherpunks repositories - gostls13.git/commitdiff
bug169
authorRuss Cox <rsc@golang.org>
Tue, 20 Oct 2009 02:55:17 +0000 (19:55 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 20 Oct 2009 02:55:17 +0000 (19:55 -0700)
R=ken
OCL=35899
CL=35899

src/cmd/gc/lex.c
test/fixedbugs/bug169.go [moved from test/bugs/bug169.go with 100% similarity]
test/golden.out

index 8cfa105ac3a39d59458199175792125e6ee9b62e..f356906e50df015ab16e0ceca0d57d5f842c5133 100644 (file)
@@ -537,8 +537,10 @@ l0:
 
        case '\'':
                /* '.' */
-               if(escchar('\'', &escflag, &v))
-                       v = '\'';       // allow '''
+               if(escchar('\'', &escflag, &v)) {
+                       yyerror("empty character literal or unescaped ' in character literal");
+                       v = '\'';
+               }
                if(!escchar('\'', &escflag, &v)) {
                        yyerror("missing '");
                        ungetc(v);
similarity index 100%
rename from test/bugs/bug169.go
rename to test/fixedbugs/bug169.go
index 90f21172cf155f2fc7db2ff27a1a90e284e80655..6d70cb9e0d4d4d70618b85aabeed6eeebc329f0c 100644 (file)
@@ -147,9 +147,6 @@ BUG: errchk: command succeeded unexpectedly
 123
 BUG: should fail
 
-=========== bugs/bug169.go
-BUG: errchk: command succeeded unexpectedly
-
 =========== bugs/bug193.go
 BUG: errchk: bugs/bug193.go:14: missing expected error: 'shift'