summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp/string-1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp/string-1.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp/string-1.C9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp/string-1.C b/gcc/testsuite/g++.dg/cpp/string-1.C
new file mode 100644
index 000000000..da3133071
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp/string-1.C
@@ -0,0 +1,9 @@
+// Test location of diagnostics for interpreting strings. Bug 17964.
+// Origin: Joseph Myers <joseph@codesourcery.com>
+// { dg-do compile }
+
+const char *s = "\q"; // { dg-error "unknown escape sequence" }
+
+const char *t = "\ "; // { dg-error "unknown escape sequence" }
+
+const char *u = "";