aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-6.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-6.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-6.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-6.c
new file mode 100644
index 000000000..426b3c75c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-6.c
@@ -0,0 +1,15 @@
+/* PR c/12446 */
+/* Origin: Keith Thompson <kst@cts.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+
+struct s { char c[1]; };
+
+extern struct s foo(void);
+
+void bar(void)
+{
+ char *ptr = foo().c; /* { dg-bogus "non-lvalue" "array not decaying to lvalue" } */
+}