[PATCH] D148712: [clang] Diagnose shadowing of lambda's template parameter by a capture

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 19 11:37:01 PDT 2023


shafik added inline comments.


================
Comment at: clang/test/CXX/expr/expr.prim/expr.prim.lambda/expr.prim.lambda.capture/p5.cpp:7
+                                     // expected-note {{variable 'x' is explicitly captured here}}
+  auto h = [y = 0]<typename y>(y) { return 0; };  // expected-error {{declaration of 'y' shadows template parameter}} \
+                                                  // expected-note {{template parameter is declared here}}
----------------
I don't know if shadowing is the correct term to use here. The wording simply says they can't have the same name. I think the diagnostic should say something similar. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148712/new/

https://reviews.llvm.org/D148712



More information about the cfe-commits mailing list