1c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor// RUN: %clang_cc1 -std=c11 %s -verify
2c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor
3c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregortypedef int type;
4c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregortypedef type type;
5c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregortypedef int type;
6c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor
7c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregorvoid f(int N) {
8c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor  typedef int type2;
9c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor  typedef type type2;
10c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor  typedef int type2;
11c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor
12c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor  typedef int vla[N]; // expected-note{{previous definition is here}}
13ec3bd728cc6505c98543b001a1988c237f5fb9a9Douglas Gregor  typedef int vla[N]; // expected-error{{redefinition of typedef for variably-modified type 'int [N]'}}
1472b8f788149de5d667a0f76b674685bbd82dfc46Douglas Gregor
1572b8f788149de5d667a0f76b674685bbd82dfc46Douglas Gregor  typedef int vla2[N];
1672b8f788149de5d667a0f76b674685bbd82dfc46Douglas Gregor  typedef vla2 vla3; // expected-note{{previous definition is here}}
1772b8f788149de5d667a0f76b674685bbd82dfc46Douglas Gregor  typedef vla2 vla3; // expected-error{{redefinition of typedef for variably-modified type 'vla2' (aka 'int [N]')}}
18c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor}
19