[PATCH] D131202: [Clang] Fix capture of values initialized by bitfields

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 4 14:30:44 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/test/SemaCXX/lambda-expressions.cpp:680
+  auto l = [&]() {
+          a;   // expected-error{{cannot capture a bit-field by reference}}
+          b;
----------------
This still should be accepted -- `a` is an `const int &` that was materialized from a temporary and lifetime extended, so it's not a bit-field.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131202



More information about the cfe-commits mailing list