merge-decls.c revision 3ebc36a1c15537684a62a02a2d6c94bbb4a9e4cc
1// RUN: clang %s -verify -fsyntax-only
2
3void foo(void);
4void foo(void) {}
5void foo(void);
6void foo(void); // expected-note {{previous declaration is here}}
7
8void foo(int); // expected-error {{conflicting types for 'foo'}}
9
10int funcdef()
11{
12 return 0;
13}
14
15int funcdef();
16
17int funcdef2() { return 0; } // expected-note {{previous definition is here}}
18int funcdef2() { return 0; } // expected-error {{redefinition of 'funcdef2'}}
19
20// PR2502
21void (*f)(void);
22void (*f)() = 0;
23
24typedef __attribute__(( ext_vector_type(2) )) int Vi2;
25typedef __attribute__(( ext_vector_type(2) )) float Vf2;
26
27Vf2 g0; // expected-note {{previous definition is here}}
28Vi2 g0; // expected-error {{redefinition of 'g0'}}
29
30_Complex int g1; // expected-note {{previous definition is here}}
31_Complex float g1; // expected-error {{redefinition of 'g1'}}
32
33// rdar://6096412
34extern char i6096412[10];
35extern char i6096412[];
36void foo6096412(void) {
37  int x = sizeof(i6096412);
38}
39
40