Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / SemaCXX / block-packs.cpp
blob8f63c98fa2745186b68f605900c8bd28769386ab
1 // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fsyntax-only -verify -Wno-unused %s
2 // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fsyntax-only -verify -Wno-unused %s -frecovery-ast -frecovery-ast-type
4 // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fsyntax-only -verify -Wno-unused -fexperimental-new-constant-interpreter %s
5 // RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fsyntax-only -verify -Wno-unused -frecovery-ast -frecovery-ast-type -fexperimental-new-constant-interpreter %s
7 template <typename ...Ts>
8 void f() {
9 ((^ { Ts t; }), ...);
10 ((^ (Ts t) {}), ...);
11 ((^ Ts () {}), ...);
13 ^ { Ts t; }; // expected-error {{unexpanded parameter pack 'Ts'}}
14 ^ (Ts t) {}; // expected-error {{unexpanded parameter pack 'Ts'}}
15 ^ Ts () {}; // expected-error {{unexpanded parameter pack 'Ts'}}
18 template <typename ...Ts>
19 void gh109148() {
20 (^Ts); // expected-error {{expected expression}}
22 [] {
23 (^Ts); // expected-error {{expected expression}}
24 ^Ts; // expected-error {{expected expression}}
25 ^(Ts); // expected-error {{expected expression}}
26 ^ Ts); // expected-error {{expected expression}}
29 ([] {
30 (^Ts); // expected-error {{expected expression}}
31 ^Ts; // expected-error {{expected expression}}
32 ^(Ts); // expected-error {{expected expression}}
33 ^ Ts); // expected-error {{expected expression}}
34 }, ...); // expected-error {{pack expansion does not contain any unexpanded parameter packs}}
36 [] { // expected-error {{unexpanded parameter pack 'Ts'}}
37 ^ (Ts) {};
40 [] { // expected-error {{unexpanded parameter pack 'Ts'}}
41 ^ { Ts x; };
44 [] { // expected-error {{unexpanded parameter pack 'Ts'}}
45 Ts s;
46 (^Ts); // expected-error {{expected expression}}
49 ([] {
50 Ts s;
51 (^Ts); // expected-error {{expected expression}}
52 }, ...);
54 [] { // expected-error {{unexpanded parameter pack 'Ts'}}
55 ^ { Ts s; return not_defined; }; // expected-error {{use of undeclared identifier 'not_defined'}}
59 void g() {
60 f<>();
61 f<int>();
62 f<long, float>();
64 gh109148<>();
65 gh109148<int>();
66 gh109148<long, float>();