Skip to content

Commit c1c257d

Browse files
committed
Add test for lambda in template
1 parent 4f514bf commit c1c257d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

clang/test/SemaCXX/cxx2c-expansion-stmts.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,3 +1080,12 @@ void dependent_incomplete_type(T& s) {
10801080
}
10811081

10821082
template void dependent_incomplete_type<Incomplete>(Incomplete&); // expected-note {{in instantiation of function template specialization 'dependent_incomplete_type<Incomplete>' requested here}}
1083+
1084+
template <typename T>
1085+
void lambda_template(T a) {
1086+
template for (auto x : a) {} // expected-error {{cannot expand lambda closure type}}
1087+
}
1088+
1089+
void lambda_template_call() {
1090+
lambda_template([]{}); // expected-note {{in instantiation of function template specialization}}
1091+
}

0 commit comments

Comments
 (0)