[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / CXX / expr / expr.prim / expr.prim.lambda / p13.cpp
blobb55beb7d4ed78794941afb3ae28f87c0696de879
1 // RUN: %clang_cc1 -std=c++11 %s -Wunused -Wno-unused-lambda-capture -verify
3 void f2() {
4 int i = 1;
5 void g1(int = ([i]{ return i; })()); // expected-error{{lambda expression in default argument cannot capture any entity}}
6 void g2(int = ([i]{ return 0; })()); // expected-error{{lambda expression in default argument cannot capture any entity}}
7 void g3(int = ([=]{ return i; })()); // expected-error{{lambda expression in default argument cannot capture any entity}}
8 void g4(int = ([=]{ return 0; })());
9 void g5(int = ([]{ return sizeof i; })());
12 namespace lambda_in_default_args {
13 int f(int = [] () -> int { int n; return ++n; } ());
14 template<typename T> T g(T = [] () -> T { T n; return ++n; } ());
15 int k = f() + g<int>();