1 // RUN: %clang_cc1 -fsyntax-only -verify %s
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'))}}
9 typedef int result_type
; // expected-note {{previous definition is here}}
10 typedef INT result_type
; // expected-error {{redefinition of 'result_type'}}
13 struct Y
; // expected-note{{previous definition is here}}
14 typedef int Y
; // expected-error{{typedef redefinition with different types ('int' vs 'Y')}}
16 typedef int Y2
; // expected-note{{declared here}}
17 struct Y2
; // expected-error{{definition of type 'Y2' conflicts with typedef of the same name}}
19 void f(); // expected-note{{previous definition is here}}
20 typedef int f
; // expected-error{{redefinition of 'f' as different kind of symbol}}
22 typedef int f2
; // expected-note{{previous definition is here}}
23 void f2(); // expected-error{{redefinition of 'f2' as different kind of symbol}}
35 namespace a
{ using test1::foo
; };
54 typedef int operator! (A
); // expected-error{{typedef name must be an identifier}}
55 int i
= !A(); // expected-error{{invalid argument type}}
59 typedef T
f(T t
) { return t
; } // expected-error {{function definition declared 'typedef'}}
67 static const unsigned C
= 1;
70 typedef int q
[C
== 1 ? 1 : -1]; // expected-note{{previous definition is here}}
71 typedef int q
[C
>= 1 ? 2 : -2]; // expected-error{{typedef redefinition with different types ('int[2]' vs 'int[1]')}}
72 typedef int n
[C
== 1 ? 1 : -1];
73 typedef int n
[C
>= 1 ? 1 : -1];
82 typedef int q
[1]; // expected-note{{previous definition is here}}
83 typedef int q
[T
]; // expected-error{{typedef redefinition with different types ('int[2]' vs 'int[1]')}}
93 b2
.f(); // expected-note{{in instantiation of member function 'PR11630::S2<2>::f' requested here}}