r364340 - Add regression test for PR41576 (which is already fixed in trunk,
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 25 11:42:53 PDT 2019
Author: rsmith
Date: Tue Jun 25 11:42:53 2019
New Revision: 364340
URL: http://llvm.org/viewvc/llvm-project?rev=364340&view=rev
Log:
Add regression test for PR41576 (which is already fixed in trunk,
perhaps by r361300).
Modified:
cfe/trunk/test/SemaTemplate/lambda-capture-pack.cpp
Modified: cfe/trunk/test/SemaTemplate/lambda-capture-pack.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/lambda-capture-pack.cpp?rev=364340&r1=364339&r2=364340&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/lambda-capture-pack.cpp (original)
+++ cfe/trunk/test/SemaTemplate/lambda-capture-pack.cpp Tue Jun 25 11:42:53 2019
@@ -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}}
+}
More information about the cfe-commits
mailing list