summaryrefslogtreecommitdiff
path: root/test/SemaTemplate
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-06-25 18:42:53 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-06-25 18:42:53 +0000
commit87419c82727ac16a636d56842649852874c742f0 (patch)
tree9d254b9b69061601baa7bfe2129f7a474acd0c33 /test/SemaTemplate
parent23849425dc9b0a8d030a84242699d8addbeaad6d (diff)
downloadclang-87419c82727ac16a636d56842649852874c742f0.tar.gz
Add regression test for PR41576 (which is already fixed in trunk,
perhaps by r361300). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364340 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r--test/SemaTemplate/lambda-capture-pack.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/SemaTemplate/lambda-capture-pack.cpp b/test/SemaTemplate/lambda-capture-pack.cpp
index 2fe576769d..8b8a55ccd7 100644
--- a/test/SemaTemplate/lambda-capture-pack.cpp
+++ b/test/SemaTemplate/lambda-capture-pack.cpp
@@ -1,5 +1,4 @@
// RUN: %clang_cc1 -std=c++2a -verify %s
-// expected-no-diagnostics
template<typename ...T, typename ...Lambda> void check_sizes(Lambda ...L) {
static_assert(((sizeof(T) == sizeof(Lambda)) && ...));
@@ -15,3 +14,12 @@ template<typename ...T> void f(T ...v) {
}
template void f(int, char, double);
+
+namespace PR41576 {
+ template <class... Xs> constexpr int f(Xs ...xs) {
+ return [&](auto ...ys) { // expected-note {{instantiation}}
+ return ((xs + ys), ...); // expected-warning {{unused}}
+ }(1, 2);
+ }
+ static_assert(f(3, 4) == 6); // expected-note {{instantiation}}
+}