Add regression test for PR41576 (which is already fixed in trunk,

perhaps by r361300).

llvm-svn: 364340
This commit is contained in:
Richard Smith 2019-06-25 18:42:53 +00:00
parent 4be636ebb3
commit 30519a68d5
1 changed files with 9 additions and 1 deletions

View File

@ -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}}
}