c11-typedef-redef.c revision c0004df84fca9225b66a50adc66cf21c34298227
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}} 13c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor typedef int vla[N]; // expected-error{{typedef redefinition with different types ('int [N]' vs 'int [N]')}} 14c0004df84fca9225b66a50adc66cf21c34298227Douglas Gregor} 15