[clang-tools-extra] [clang-tidy] Fix when std::ranges::fix is offered on a pointer type in `modernize-use-ranges` (PR #226739)

via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 26 16:17:40 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tools-extra

Author: Umut Zengin (ZenginU)

<details>
<summary>Changes</summary>

First PR to LLVM, so will be tagging the reviewers.
@<!-- -->zeyi2 @<!-- -->vbvictor @<!-- -->localspook 

Fixes the pointer derenferencing with the help of `fixit::formatDereference`. Most of the Diff is caused by `RangeArg`refactoring. 

Did not use StringRef as `formatDereference` returns a `std::string`.

Assisted by Codex for codebase exploration and utility usage.

Fixes:
#<!-- -->188257 

Godbolt link from original issuer:
https://godbolt.org/z/7af31ox3j

---
Full diff: https://github.com/llvm/llvm-project/pull/226739.diff


2 Files Affected:

- (modified) clang-tools-extra/clang-tidy/utils/UseRangesCheck.cpp (+11-4) 
- (modified) clang-tools-extra/test/clang-tidy/checkers/modernize/use-ranges.cpp (+14-1) 


``````````diff
The server is unavailable at this time. Please wait a few minutes before you try again.
``````````

</details>


https://github.com/llvm/llvm-project/pull/226739


More information about the cfe-commits mailing list