1 // Positive test for auto 2 // { dg-do run } 3 // { dg-options "-std=c++0x" } 4 5 #include <typeinfo> 6 extern "C" void abort(); 7 main()8int main() 9 { 10 if (auto i = 42L) 11 { 12 if (typeid (i) != typeid (long int)) 13 abort (); 14 } 15 16 while (auto i = 1) 17 { 18 if (typeid (i) != typeid (int)) 19 abort (); 20 break; 21 } 22 } 23