[clang-tidy] Implement CppCoreGuideline CP.53
authorChris Cotter <ccotter14@bloomberg.net>
Thu, 5 Jan 2023 12:58:34 +0000 (12:58 +0000)
committerCarlos Galvez <carlosgalvezp@gmail.com>
Thu, 5 Jan 2023 13:57:22 +0000 (13:57 +0000)
commitb06b248ad9dc1b50dcf474616c3d586d47270a01
treefdc49bd1c0acca79baffcb71b127219b8f2148ea
parent2d9b4a50cae8d18516a61977768a48d1f92ac33c
[clang-tidy] Implement CppCoreGuideline CP.53

Implement CppCoreGuideline CP.53 to warn when a coroutine accepts
references parameters. Although the guideline mentions that it is safe
to access a reference parameter before suspension points, the guideline
recommends flagging all coroutine parameter references.

Reviewed By: carlosgalvezp

Differential Revision: https://reviews.llvm.org/D140793
clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidReferenceCoroutineParametersCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidReferenceCoroutineParametersCheck.h [new file with mode: 0644]
clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-reference-coroutine-parameters.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/avoid-reference-coroutine-parameters.cpp [new file with mode: 0644]