================
@@ -17,3 +17,13 @@ struct X0 {
template <typename... Ts>
void defaultpack(Ts... = 0) {} // expected-error{{parameter pack cannot have a
default argument}}
+
+// A lambda parameter pack whose default argument is a pack expansion
+// referencing the enclosing function's parameter pack must be diagnosed
+// without crashing.
+template <class... Types> void lambda_pack_default_arg(Types... args) {
+ auto lm = [](Types... = args...) {}; // expected-error{{parameter pack
cannot have a default argument}} \
+ // expected-warning{{'...' in this
location creates a C-style varargs function}} \
+ // expected-note{{preceding '...'
declares a function parameter pack}} \
+ // expected-note{{insert ',' before
'...' to silence this warning}}
----------------
cor3ntin wrote:
This warning should not be emitted - can you add a `//FIXME: do not produce
these diagnostics` ?
https://github.com/llvm/llvm-project/pull/210718
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits