xref: /llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/expr.prim.lambda.capture/p5.cpp (revision 0fb84bc7fdec1c20c2461e54d5c994939fe5b47f)
1 // RUN: %clang_cc1 -std=c++20 -verify %s
2 
f()3 void f() {
4   int x = 0;
5   auto g = [x](int x) { return 0; }; // expected-error {{a lambda parameter cannot shadow an explicitly captured entity}} \
6                                      // expected-note {{variable 'x' is explicitly captured here}}
7   auto h = [y = 0]<typename y>(y) { return 0; };  // expected-error {{declaration of 'y' shadows template parameter}} \
8                                                   // expected-note {{template parameter is declared here}}
9 
10 }
11