[AMDGPU] Update base addr of dyn alloca considering GrowingUp stack (#119822)
[llvm-project.git] / clang / test / CXX / temp / temp.decls / temp.variadic / ext-blocks.cpp
blob6d9d8c50af68e0fb3868c58be888c2c4b984ee0e
1 // RUN: %clang_cc1 -std=c++11 -fblocks -fsyntax-only -verify %s
3 // Tests the use of blocks with variadic templates.
4 template<typename ...Args>
5 int f0(Args ...args) {
6 return ^ {
7 return sizeof...(Args);
8 }() + ^ {
9 return sizeof...(args);
10 }();
13 template<typename ...Args>
14 int f1(Args ...args) {
15 return ^ {
16 return f0(args...);
17 }();
20 template int f0(int, float, double);
21 template int f1(const char*, int, float, double);
23 template<typename ...Args>
24 int f2(Args ...args) {
25 return ^(Args ...block_args) {
26 return f1(block_args...);
27 }(args + 0 ...);
30 template int f2(const char*, int, float, double);
32 template<typename ...Args>
33 int f3(Args ...args) {
34 return ^(Args *...block_args) {
35 return f1(block_args...);
36 }(&args...);
39 template int f3(const char*, int, float, double);
41 template<typename ...Args>
42 int PR9953(Args ...args) {
43 return ^(Args *...block_args) {
44 return f1(block_args); // expected-error{{expression contains unexpanded parameter pack 'block_args'}}
45 }(&args...);