[hackers] [scc] Test declaration of a variable with the same name that a typedef || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sun, 10 Jan 2016 09:15:59 +0100 (CET)

commit 9c4b37ce9ec9de17c87e0bea6fa320bac1f146c6
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Jan 9 23:44:21 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sat Jan 9 23:44:21 2016 +0100

    Test declaration of a variable with the same name that a typedef

diff --git a/cc1/tests/test034.c b/cc1/tests/test034.c
index 6b05d49..0cb2cd8 100644
--- a/cc1/tests/test034.c
+++ b/cc1/tests/test034.c
_AT_@ -3,6 +3,7 @@
 name: TEST034
 description: Basic test for incomplete structures
 output:
+test034.c:45: error: declared variable 'bar' of incomplete type
 X3 S2 x
 F4 I E
 X5 F4 foo
_AT_@ -18,6 +19,8 @@ G5 F4 foo
         X3 M9 .I #I0 :I
         r X3 M9 .I
 }
+X13 S11 bar2
+test034.c:45: error: redeclaration of 'bar'
 */
 
 extern struct X x;
_AT_@ -36,3 +39,7 @@ int foo()
         x.v = 0;
         return x.v;
 }
+
+typedef struct bar bar;
+extern bar bar2;
+bar bar;
Received on Sun Jan 10 2016 - 09:15:59 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 10 2016 - 09:24:20 CET