]> Cypherpunks repositories - gostls13.git/commitdiff
`` strings should not accept newlines as characters
authorRobert Griesemer <gri@golang.org>
Wed, 17 Jun 2009 18:44:51 +0000 (11:44 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 17 Jun 2009 18:44:51 +0000 (11:44 -0700)
R=r
DELTA=17  (17 added, 0 deleted, 0 changed)
OCL=30417
CL=30422

test/bugs/bug164.go [new file with mode: 0644]
test/golden.out

diff --git a/test/bugs/bug164.go b/test/bugs/bug164.go
new file mode 100644 (file)
index 0000000..7a78c86
--- /dev/null
@@ -0,0 +1,18 @@
+// $G $D/$F.go
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+// Multi-line string literal do not allow newline chars according to spec
+// but 6g accepts this code with the newlines interpreted as newlines.
+
+const s = `
+Hello, World!
+`
+
+func main() {
+       print(s)
+}
index 60e6f6f566e072ec9d49b213dd9467882d2b2cf9..289b12e32a9271f8d027f1e2929cfc07546ecbbf 100644 (file)
@@ -108,6 +108,9 @@ BUG: should fail
 =========== bugs/bug163.go
 BUG: should not compile
 
+=========== bugs/bug164.go
+BUG: should not compile
+
 =========== fixedbugs/bug016.go
 fixedbugs/bug016.go:7: constant -3 overflows uint