aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr35652.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr35652.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr35652.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr35652.c b/gcc/testsuite/gcc.dg/pr35652.c
new file mode 100644
index 00000000000..50ec3acf10a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr35652.c
@@ -0,0 +1,13 @@
+/* PR c++/35652: wrong location and duplicated warning.
+ { dg-do compile }
+ { dg-options "" } */
+int bar()
+{
+ const char *s = 'z' + "y"; /* { dg-warning "offset '122' outside bounds of constant string" } */
+}
+
+int g()
+{
+ char str[2];
+ const char *p = str + sizeof(str);
+}