commit | 3b1e18c2dba850922bc259a258e65490058e523d | [log] [tgz] |
---|---|---|
author | Congcong Cai <congcongcai0907@163.com> | Mon Mar 17 15:11:43 2025 +0800 |
committer | GitHub <noreply@github.com> | Mon Mar 17 15:11:43 2025 +0800 |
tree | 66d581fd18bb49efb525274508d3315d63b547ce | |
parent | 7eb8b731784722669106267764c74997e9a63cbe [diff] |
[clang-tidy] Add new check bugprone-capture-this-by-field (#130297) Finds lambda captures that capture the ``this`` pointer and store it as class members without handle the copy and move constructors and the assignments. Capture this in a lambda and store it as a class member is dangerous because the lambda can outlive the object it captures. Especially when the object is copied or moved, the captured ``this`` pointer will be implicitly propagated to the new object. Most of the time, people will believe that the captured ``this`` pointer points to the new object, which will lead to bugs. Fixes: #120863 --------- Co-authored-by: Baranov Victor <70346889+vbvictor@users.noreply.github.com> Co-authored-by: Baranov Victor <bar.victor.2002@gmail.com>
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.