p4.cpp revision 34b41d939a1328f484511c6002ba2456db879a29
1// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x 2 3template<typename T> 4struct only { 5 only(T); 6 template<typename U> only(U) = delete; 7}; 8 9void f() { 10 if (auto a = true) { 11 } 12 13 switch (auto a = 0) { 14 } 15 16 while (auto a = false) { 17 } 18 19 for (; auto a = false; ) { 20 } 21 22 new const auto (0); 23 new (auto) (0.0); 24 25#if 0 26 // When clang supports for-range: 27 for (auto i : {1,2,3}) { 28 } 29 30 // When clang supports inline initialization of members. 31 class X { 32 static const auto &n = 'x'; 33 }; 34#endif 35} 36