1 // RUN: clang -fsyntax-only -verify %s
2 typedef int INT;
3 typedef INT REALLY_INT; // expected-note {{previous definition is here}}
4 typedef REALLY_INT REALLY_REALLY_INT;
5 typedef REALLY_INT BOB;
6 typedef float REALLY_INT; // expected-error{{typedef redefinition with different types ('float' vs 'INT' (aka 'int'))}}
7 
8 struct X {
9   typedef int result_type; // expected-note {{previous definition is here}}
10   typedef INT result_type; // expected-error {{redefinition of 'result_type'}}
11 };
12 
13 struct Y; // expected-note{{previous definition is here}}
14 typedef int Y;  // expected-error{{typedef redefinition with different types ('int' vs 'struct Y')}}
15 
16 typedef int Y2; // expected-note{{previous definition is here}}
17 struct Y2; // expected-error{{definition of type 'struct Y2' conflicts with typedef of the same name}}
18 
19 void f(); // expected-note{{previous definition is here}}
20 typedef int f; // expected-error{{redefinition of 'f' as different kind of symbol}}
21 
22 typedef int f2; // expected-note{{previous definition is here}}
23 void f2(); // expected-error{{redefinition of 'f2' as different kind of symbol}}
24 
25 typedef struct s s;
26 typedef int I;
27 typedef int I;
28 typedef I I;
29 
30 struct s { };
31 
32 typedef class st { /* ... */ } st; // expected-note{{previous use is here}}
33 struct st; // expected-error{{use of 'st' with tag type that does not match previous declaration}}
34