From 952eddef9aff85b1e92626e89baaf7a360e2ac85 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 22 Dec 2013 00:07:40 +0000 Subject: Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3): https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841 --- test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp | 25 +++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp') diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp index 82fc04a..4ae34de 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p23.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify +// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify -Wno-c++1y-extensions +// RUN: %clang_cc1 -fsyntax-only -std=c++1y %s -verify void print(); @@ -56,3 +57,25 @@ void variadic_lambda(Args... args) { } template void variadic_lambda(int*, float*, double*); + +template +void init_capture_pack_err(Args ...args) { + [as(args)...] {} (); // expected-error {{expected ','}} + [as...(args)]{} (); // expected-error {{expected ','}} +} + +template +void init_capture_pack_multi(Args ...args) { + [as(args...)] {} (); // expected-error {{initializer missing for lambda capture 'as'}} expected-error {{multiple}} +} +template void init_capture_pack_multi(); // expected-note {{instantiation}} +template void init_capture_pack_multi(int); +template void init_capture_pack_multi(int, int); // expected-note {{instantiation}} + +template +void init_capture_pack_outer(Args ...args) { + print([as(args)] { return sizeof(as); } () ...); +} +template void init_capture_pack_outer(); +template void init_capture_pack_outer(int); +template void init_capture_pack_outer(int, int); -- cgit v1.1