1 // RUN: %clang_cc1 -std=c++2c -verify -fsyntax-only %s 2 3 template<typename... T> 4 struct S { 5 T...1; // expected-error{{expected member name or ';' after declaration specifiers}} 6 T...[; // expected-error{{expected expression}} \ 7 // expected-error{{expected ']'}} \ 8 // expected-note {{to match this '['}} \ 9 // expected-warning{{declaration does not declare anything}} 10 11 T...[1; // expected-error{{expected ']'}} \ 12 // expected-note {{to match this '['}} \ 13 // expected-warning{{declaration does not declare anything}} 14 15 T...[]; // expected-error{{expected member name or ';' after declaration specifiers}} 16 17 void f(auto... v) { 18 decltype(v...[1]) a = v...[1]; 19 decltype(v...[1]) b = v...[]; // expected-error{{expected expression}} 20 21 decltype(v...[1]) c = v...[ ; // expected-error{{expected expression}}\ 22 // expected-error{{expected ']'}} \ 23 // expected-note {{to match this '['}} 24 } 25 }; 26 27 28 template <typename...> 29 struct typelist{}; 30 31 template <typename... T> 32 requires requires(T...[0]) { {T...[0](0)}; } 33 struct SS : T...[1] { 34 [[maybe_unused]] T...[1] base = {}; 35 using foo = T...[1]; 36 SS() 37 : T...[1]() 38 {} 39 typelist<T...[0]> a; 40 const T...[0] f(T...[0] && p) noexcept((T...[0])0) { 41 T...[0] (*test)(const volatile T...[0]**); 42 thread_local T...[0] d; 43 [[maybe_unused]] T...[0] a = p; 44 auto ptr = new T...[0](0); 45 (*ptr).~T...[0](); 46 return T...[0](0); 47 typename T...[1]::foo b = 0; 48 T...[1]::i = 0; 49 return (T...[0])(a); 50 new T...[0]; 51 [[maybe_unused]] auto l = []<T...[0]>(T...[0][1]) -> T...[0]{return{};}; 52 [[maybe_unused]] auto _ = l.template operator()<T...[0]{}>({0}); 53 } 54 operator T...[0]() const{} 55 }; 56 57 struct base { 58 using foo = int; 59 static inline int i = 42; 60 }; 61 62 int main() { 63 SS<int, base>().f(0); 64 } 65 66 67 namespace GH111460 { 68 template <typename... T> 69 requires( ); // expected-error {{expected expression}} 70 struct SS { 71 void f( ) { 72 (*p).~T...[](); // expected-error {{use of undeclared identifier 'p'}} 73 } 74 }; 75 } 76 77 namespace GH119072 { 78 79 template<typename... Ts> 80 void foo() { 81 decltype(Ts...[0]::t) value; 82 } 83 84 } 85