Douglas Gregor | c0004df | 2012-01-11 04:25:01 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c11 %s -verify |
| 2 | |
| 3 | typedef int type; |
| 4 | typedef type type; |
| 5 | typedef int type; |
| 6 | |
| 7 | void f(int N) { |
| 8 | typedef int type2; |
| 9 | typedef type type2; |
| 10 | typedef int type2; |
| 11 | |
| 12 | typedef int vla[N]; // expected-note{{previous definition is here}} |
Douglas Gregor | ec3bd72 | 2012-01-11 22:33:48 +0000 | [diff] [blame] | 13 | typedef int vla[N]; // expected-error{{redefinition of typedef for variably-modified type 'int [N]'}} |
Douglas Gregor | 72b8f78 | 2012-01-11 22:43:46 +0000 | [diff] [blame] | 14 | |
| 15 | typedef int vla2[N]; |
| 16 | typedef vla2 vla3; // expected-note{{previous definition is here}} |
| 17 | typedef vla2 vla3; // expected-error{{redefinition of typedef for variably-modified type 'vla2' (aka 'int [N]')}} |
Douglas Gregor | c0004df | 2012-01-11 04:25:01 +0000 | [diff] [blame] | 18 | } |