Skip to content

Commit 675199f

Browse files
authored
Update fold_lambda_with_variadics.cpp
1 parent d30c84b commit 675199f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

clang/test/SemaCXX/fold_lambda_with_variadics.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ template <class = void> void f() {
1818
}(1, 2) == 3);
1919

2020
[]<class... Is>(Is... x) {
21-
return ([](auto y = Is()) { return y + 1; }() + ...); // expected-error@17 {{pack expansion does not contain any unexpanded parameter packs}} \
22-
// expected-error@18 {{invalid operands to binary expression ('void' and 'int')}}
21+
return ([](auto y = Is()) { return y + 1; }() + ...); // expected-error {{no matching function}} \
22+
// expected-note {{couldn't infer template argument 'y:auto'}} \
23+
// expected-note@-1 {{requested here}}
24+
// expected-note@#instantiate-f {{requested here}}
2325
}(1);
2426

2527
[]<class... Is>() {
@@ -96,7 +98,7 @@ template <class = void> void f() {
9698
#endif
9799
}
98100

99-
template void f(); // #instantiate-f expected-note@99 {{in instantiation of function template specialization 'GH85667::f<void>' requested here}}
101+
template void f(); // #instantiate-f
100102

101103
} // namespace GH85667
102104

@@ -119,8 +121,7 @@ int Cartesian1(auto x, auto y) {
119121
int Cartesian2(auto x, auto y) {
120122
return apply(
121123
[&](auto... xs) {
122-
return (apply([zs = xs](auto... ys) { return (ys + ...); }, y) + ...); // expected-error@109 {{cannot initialize return object of type 'int' with an rvalue of type 'void'}}
123-
// expected-note@120 {{in instantiation of function template specialization 'GH99877::apply}}
124+
return (apply([zs = xs](auto... ys) { return (ys + ...); }, y) + ...);
124125
},
125126
x);
126127
}
@@ -142,7 +143,7 @@ template <int... x> int Cartesian3(auto y) {
142143
y) +
143144
...);
144145
// - non-type template parameters,
145-
return (apply([]<int = xs>(auto... ys) { return (ys + ...); }, y) + ...); // expected-error@122 {{pack expansion does not contain any unexpanded parameter packs}}
146+
return (apply([]<int = xs>(auto... ys) { return (ys + ...); }, y) + ...);
146147
}(Ints<x...>());
147148
}
148149

@@ -175,7 +176,7 @@ void foo() {
175176
auto x = tuple({1, 2, 3});
176177
auto y = tuple({4, 5, 6});
177178
Cartesian1(x, y);
178-
Cartesian2(x, y); // expected-note@178 {{in instantiation of function template specialization 'GH99877::Cartesian2<GH99877::tuple, GH99877::tuple>' requested here}}
179+
Cartesian2(x, y);
179180
Cartesian3<1, 2, 3>(y);
180181
Cartesian4<1, 2, 3>(y);
181182
#if 0

0 commit comments

Comments
 (0)