[PATCH] D146368: [clang-tidy] Add readability-reference-to-constructed-temporary check

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 25 11:40:05 PDT 2023


PiotrZSL marked 4 inline comments as done.
PiotrZSL added inline comments.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/readability/reference-to-constructed-temporary.rst:10
+This construction is often the result of multiple code refactorings or a lack
+of developer knowledge, leading to confusion or subtle bugs. In most cases,
+what the developer really wanted to do is create a new variable rather than
----------------
xgupta wrote:
> May be good to mention dangling references and resource leakage as potential issues.
There will be no dangling references and resource leakage because lifetime of temporary is extended by variable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146368



More information about the cfe-commits mailing list