[PATCH] D158371: [clang-tidy] Fix DanglingHandleCheck to work in C++17 and later mode

Ignat Loskutov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 20 11:22:04 PDT 2023


loskutov created this revision.
loskutov added reviewers: sbenza, PiotrZSL.
loskutov added a project: clang-tools-extra.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
loskutov requested review of this revision.
Herald added a subscriber: cfe-commits.

Due to guaranteed copy elision, not only do some nodes get removed from the AST,
but also some existing nodes change the source locations they correspond to.
Hence, the check works slightly differently in pre-C++17 and C++17-and-later modes
in terms of what gets highlighted.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158371

Files:
  clang-tools-extra/clang-tidy/bugprone/DanglingHandleCheck.cpp
  clang-tools-extra/test/clang-tidy/checkers/bugprone/dangling-handle.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158371.551859.patch
Type: text/x-patch
Size: 7056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230820/22b2a3ae/attachment-0001.bin>


More information about the cfe-commits mailing list