[clang] [Sema] Fast-path simple plain auto deduction in DeduceAutoType (PR #188196)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 25 08:28:16 PDT 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results
* 53378 tests passed
* 1043 tests skipped
* 1 test failed
## Failed Tests
(click on a test name to see its output)
### Clang Tools
<details>
<summary>Clang Tools.clang-tidy/checkers/readability/qualified-auto.cpp</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
C:/Python312/python.exe C:/_work/llvm-project/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\readability\qualified-auto.cpp readability-qualified-auto C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp -config='{CheckOptions: { readability-qualified-auto.AllowedTypes: "[iI]terator$;my::ns::Ignored1;std::array<.*>::Ignored2;MyIgnoredPtr" }}'
# executed command: C:/Python312/python.exe 'C:/_work/llvm-project/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py' 'C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\readability\qualified-auto.cpp' readability-qualified-auto 'C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp' '-config={CheckOptions: { readability-qualified-auto.AllowedTypes: "[iI]terator$;my::ns::Ignored1;std::array<.*>::Ignored2;MyIgnoredPtr" }}'
# .---command stdout------------
# | Running ['clang-tidy', '--experimental-custom-checks', 'C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\tools\\extra\\test\\clang-tidy\\checkers\\readability\\Output\\qualified-auto.cpp.tmp.cpp', '-fix', '--checks=-*,readability-qualified-auto', '-config={CheckOptions: { readability-qualified-auto.AllowedTypes: "[iI]terator$;my::ns::Ignored1;std::array<.*>::Ignored2;MyIgnoredPtr" }}', '--', '-std=c++11', '-nostdinc++', '-isystem', 'C:\\_work\\llvm-project\\llvm-project\\clang-tools-extra\\test\\clang-tidy\\checkers\\Inputs\\Headers\\std']...
# | ------------------------ clang-tidy output -----------------------
# | 33 warnings generated.
# |
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:24:3: warning: 'auto TdNakedPtr' can be declared as 'auto *TdNakedPtr' [readability-qualified-auto]
# | 24 | auto TdNakedPtr = getPtr();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:24:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:27:3: warning: 'auto TdNakedPtrPtr' can be declared as 'auto *TdNakedPtrPtr' [readability-qualified-auto]
# | 27 | auto TdNakedPtrPtr = getPtrPtr();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:27:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:34:3: warning: 'auto TdNakedCPtr' can be declared as 'const auto *TdNakedCPtr' [readability-qualified-auto]
# | 34 | auto TdNakedCPtr = getCPtr();
# | | ^~~~
# | | const auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:34:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:37:3: warning: 'auto TdNakedCPtrPtr' can be declared as 'auto *TdNakedCPtrPtr' [readability-qualified-auto]
# | 37 | auto TdNakedCPtrPtr = getCPtrPtr();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:37:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:42:3: warning: 'auto &TdNakedCRef' can be declared as 'const auto &TdNakedCRef' [readability-qualified-auto]
# | 42 | auto &TdNakedCRef = getCRef();
# | | ^
# | | const
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:42:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:65:3: warning: 'auto UNakedPtr' can be declared as 'auto *UNakedPtr' [readability-qualified-auto]
# | 65 | auto UNakedPtr = getPtr();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:65:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:68:3: warning: 'auto UNakedPtrPtr' can be declared as 'auto *UNakedPtrPtr' [readability-qualified-auto]
# | 68 | auto UNakedPtrPtr = getPtrPtr();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:68:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:75:3: warning: 'auto UNakedCPtr' can be declared as 'const auto *UNakedCPtr' [readability-qualified-auto]
# | 75 | auto UNakedCPtr = getCPtr();
# | | ^~~~
# | | const auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:75:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:78:3: warning: 'auto &UNakedCRef' can be declared as 'const auto &UNakedCRef' [readability-qualified-auto]
# | 78 | auto &UNakedCRef = getCRef();
# | | ^
# | | const
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:78:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:103:3: warning: 'auto NakedPtr' can be declared as 'auto *NakedPtr' [readability-qualified-auto]
# | 103 | auto NakedPtr = getIntPtr();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:103:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:108:3: warning: 'auto NakedCPtr' can be declared as 'const auto *NakedCPtr' [readability-qualified-auto]
# | 108 | auto NakedCPtr = getCIntPtr();
# | | ^~~~
# | | const auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:108:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:114:3: warning: 'const auto ConstPtr' can be declared as 'auto *const ConstPtr' [readability-qualified-auto]
# | 114 | const auto ConstPtr = getIntPtr();
# | | ^~~~~~~~~~
# | | auto *const
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:114:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:119:3: warning: 'const auto ConstCPtr' can be declared as 'const auto *const ConstCPtr' [readability-qualified-auto]
# | 119 | const auto ConstCPtr = getCIntPtr();
# | | ^~~~~~~~~~
# | | const auto *const
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:119:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:125:3: warning: 'volatile auto VolatilePtr' can be declared as 'auto *volatile VolatilePtr' [readability-qualified-auto]
# | 125 | volatile auto VolatilePtr = getIntPtr();
# | | ^~~~~~~~~~~~~
# | | auto *volatile
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:125:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:130:3: warning: 'volatile auto VolatileCPtr' can be declared as 'const auto *volatile VolatileCPtr' [readability-qualified-auto]
# | 130 | volatile auto VolatileCPtr = getCIntPtr();
# | | ^~~~~~~~~~~~~
# | | const auto *volatile
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:130:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:137:3: warning: 'auto *QualCPtr' can be declared as 'const auto *QualCPtr' [readability-qualified-auto]
# | 137 | auto *QualCPtr = getCIntPtr();
# | | ^
# | | const
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:137:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:142:3: warning: 'auto *const ConstantQualCPtr' can be declared as 'const auto *const ConstantQualCPtr' [readability-qualified-auto]
# | 142 | auto *const ConstantQualCPtr = getCIntPtr();
# | | ^
# | | const
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:142:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:147:3: warning: 'auto *volatile VolatileQualCPtr' can be declared as 'const auto *volatile VolatileQualCPtr' [readability-qualified-auto]
# | 147 | auto *volatile VolatileQualCPtr = getCIntPtr();
# | | ^
# | | const
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:147:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:152:9: warning: 'auto *ConstQualCPtr' can be declared as 'const auto *ConstQualCPtr' [readability-qualified-auto]
# | 152 | const auto *ConstQualCPtr = getCIntPtr();
# | | ^
# | | const
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:152:9: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:155:3: warning: 'auto &CRef' can be declared as 'const auto &CRef' [readability-qualified-auto]
# | 155 | auto &CRef = *getCIntPtr();
# | | ^
# | | const
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:155:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:162:7: warning: 'auto X' can be declared as 'const auto *X' [readability-qualified-auto]
# | 162 | if (auto X = getCIntPtr()) {
# | | ^~~~
# | | const auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:162:7: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:190:8: warning: 'auto &Data' can be declared as 'const auto &Data' [readability-qualified-auto]
# | 190 | for (auto &Data : Constant) {
# | | ^
# | | const
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:190:8: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:200:8: warning: 'auto Data' can be declared as 'auto *Data' [readability-qualified-auto]
# | 200 | for (auto Data : Mutate) {
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:200:8: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:207:8: warning: 'auto Data' can be declared as 'const auto *Data' [readability-qualified-auto]
# | 207 | for (auto Data : Constant) {
# | | ^~~~
# | | const auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:207:8: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:218:8: warning: 'auto Data' can be declared as 'auto *Data' [readability-qualified-auto]
# | 218 | for (auto Data : MutateTemplate) {
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:218:8: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:226:8: warning: 'auto Data' can be declared as 'const auto *Data' [readability-qualified-auto]
# | 226 | for (auto Data : ConstantTemplate) {
# | | ^~~~
# | | const auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:226:8: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:239:10: warning: 'auto Data' can be declared as 'auto *Data' [readability-qualified-auto]
# | 239 | for (auto Data : MClassTemplate) {
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:239:10: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:247:10: warning: 'auto Data' can be declared as 'const auto *Data' [readability-qualified-auto]
# | 247 | for (auto Data : CClassTemplate) {
# | | ^~~~
# | | const auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:247:10: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:400:3: warning: 'auto arr_not_ignored2' can be declared as 'auto *arr_not_ignored2' [readability-qualified-auto]
# | 400 | auto arr_not_ignored2 = new std::array<int, 4>::NotIgnored2();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:400:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:406:3: warning: 'auto not_ignored2' can be declared as 'auto *not_ignored2' [readability-qualified-auto]
# | 406 | auto not_ignored2 = new std::Ignored2();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:406:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:416:3: warning: 'auto not_ignored1' can be declared as 'auto *not_ignored1' [readability-qualified-auto]
# | 416 | auto not_ignored1 = new my::ns::NotIgnored1();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:416:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:422:3: warning: 'auto not2_ignored1' can be declared as 'auto *not2_ignored1' [readability-qualified-auto]
# | 422 | auto not2_ignored1 = new my::ns::NotIgnored2();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:422:3: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:428:3: warning: 'auto not3_ignored1' can be declared as 'auto *not3_ignored1' [readability-qualified-auto]
# | 428 | auto not3_ignored1 = new my::Ignored1();
# | | ^~~~
# | | auto *
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:428:3: note: FIX-IT applied suggested code changes
# | clang-tidy applied 33 of 33 suggested fixes.
# |
# |
# | ------------------------------------------------------------------
# | diff -u C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.orig C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp failed:
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.orig 2026-03-25 15:19:36.977916800 +0000
# | +++ C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp 2026-03-25 15:19:37.107335600 +0000
# | @@ -21,25 +21,25 @@
# | CMyRef getCRef();
# |
# |
# |
# | void foo() {
# |
# | - auto TdNakedPtr = getPtr();
# |
# | + auto *TdNakedPtr = getPtr();
# |
# | //
# |
# | //
# |
# | - auto TdNakedPtrPtr = getPtrPtr();
# |
# | + auto *TdNakedPtrPtr = getPtrPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | auto &TdNakedRef = getRef();
# |
# | auto TdNakedRefDeref = getRef();
# |
# | - auto TdNakedCPtr = getCPtr();
# |
# | + const auto *TdNakedCPtr = getCPtr();
# |
# | //
# |
# | //
# |
# | - auto TdNakedCPtrPtr = getCPtrPtr();
# |
# | + auto *TdNakedCPtrPtr = getCPtrPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - auto &TdNakedCRef = getCRef();
# |
# | + const auto &TdNakedCRef = getCRef();
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -62,20 +62,20 @@
# | CMyRef getCRef();
# |
# |
# |
# | void foo() {
# |
# | - auto UNakedPtr = getPtr();
# |
# | + auto *UNakedPtr = getPtr();
# |
# | //
# |
# | //
# |
# | - auto UNakedPtrPtr = getPtrPtr();
# |
# | + auto *UNakedPtrPtr = getPtrPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | auto &UNakedRef = getRef();
# |
# | auto UNakedRefDeref = getRef();
# |
# | - auto UNakedCPtr = getCPtr();
# |
# | + const auto *UNakedCPtr = getCPtr();
# |
# | //
# |
# | //
# |
# | - auto &UNakedCRef = getCRef();
# |
# | + const auto &UNakedCRef = getCRef();
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -100,66 +100,66 @@
# | // make sure check disregards auto types that aren't pointers or references
# |
# | auto AutoInt = getInt();
# |
# |
# |
# | - auto NakedPtr = getIntPtr();
# |
# | + auto *NakedPtr = getIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - auto NakedCPtr = getCIntPtr();
# |
# | + const auto *NakedCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | - const auto ConstPtr = getIntPtr();
# |
# | + auto *const ConstPtr = getIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - const auto ConstCPtr = getCIntPtr();
# |
# | + const auto *const ConstCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | - volatile auto VolatilePtr = getIntPtr();
# |
# | + auto *volatile VolatilePtr = getIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - volatile auto VolatileCPtr = getCIntPtr();
# |
# | + const auto *volatile VolatileCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | auto *QualPtr = getIntPtr();
# |
# | - auto *QualCPtr = getCIntPtr();
# |
# | + const auto *QualCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - auto *const ConstantQualCPtr = getCIntPtr();
# |
# | + const auto *const ConstantQualCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - auto *volatile VolatileQualCPtr = getCIntPtr();
# |
# | + const auto *volatile VolatileQualCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - const auto *ConstQualCPtr = getCIntPtr();
# |
# | + const const auto *ConstQualCPtr = getCIntPtr();
# |
# |
# |
# | auto &Ref = *getIntPtr();
# |
# | - auto &CRef = *getCIntPtr();
# |
# | + const auto &CRef = *getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | const auto &ConstCRef = *getCIntPtr();
# |
# |
# |
# | - if (auto X = getCIntPtr()) {
# |
# | + if (const auto *X = getCIntPtr()) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -187,7 +187,7 @@
# | for (auto &Data : Mutate) {
# |
# | change(Data);
# |
# | }
# |
# | - for (auto &Data : Constant) {
# |
# | + for (const auto &Data : Constant) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -197,14 +197,14 @@
# | }
# |
# |
# |
# | void loopPtr(const std::vector<int *> &Mutate, const std::vector<const int *> &Constant) {
# |
# | - for (auto Data : Mutate) {
# |
# | + for (auto *Data : Mutate) {
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | change(*Data);
# |
# | }
# |
# | - for (auto Data : Constant) {
# |
# | + for (const auto *Data : Constant) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -215,7 +215,7 @@
# |
# |
# | template <typename T>
# |
# | void tempLoopPtr(std::vector<T *> &MutateTemplate, std::vector<const T *> &ConstantTemplate) {
# |
# | - for (auto Data : MutateTemplate) {
# |
# | + for (auto *Data : MutateTemplate) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -223,7 +223,7 @@
# | change(*Data);
# |
# | }
# |
# | //FixMe
# |
# | - for (auto Data : ConstantTemplate) {
# |
# | + for (const auto *Data : ConstantTemplate) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -236,7 +236,7 @@
# | class TemplateLoopPtr {
# |
# | public:
# |
# | void operator()(const std::vector<T *> &MClassTemplate, const std::vector<const T *> &CClassTemplate) {
# |
# | - for (auto Data : MClassTemplate) {
# |
# | + for (auto *Data : MClassTemplate) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -244,7 +244,7 @@
# | change(*Data);
# |
# | }
# |
# | //FixMe
# |
# | - for (auto Data : CClassTemplate) {
# |
# | + for (const auto *Data : CClassTemplate) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -397,13 +397,13 @@
# | //
# |
# | //
# |
# |
# |
# | - auto arr_not_ignored2 = new std::array<int, 4>::NotIgnored2();
# |
# | + auto *arr_not_ignored2 = new std::array<int, 4>::NotIgnored2();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | - auto not_ignored2 = new std::Ignored2();
# |
# | + auto *not_ignored2 = new std::Ignored2();
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -413,19 +413,19 @@
# | //
# |
# | //
# |
# |
# |
# | - auto not_ignored1 = new my::ns::NotIgnored1();
# |
# | + auto *not_ignored1 = new my::ns::NotIgnored1();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | - auto not2_ignored1 = new my::ns::NotIgnored2();
# |
# | + auto *not2_ignored1 = new my::ns::NotIgnored2();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | - auto not3_ignored1 = new my::Ignored1();
# |
# | + auto *not3_ignored1 = new my::Ignored1();
# |
# | //
# |
# | //
# |
# | //
# |
# |
# | ------------------------------ Fixes -----------------------------
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.orig 2026-03-25 15:19:36.977916800 +0000
# | +++ C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp 2026-03-25 15:19:37.107335600 +0000
# | @@ -21,25 +21,25 @@
# | CMyRef getCRef();
# |
# |
# |
# | void foo() {
# |
# | - auto TdNakedPtr = getPtr();
# |
# | + auto *TdNakedPtr = getPtr();
# |
# | //
# |
# | //
# |
# | - auto TdNakedPtrPtr = getPtrPtr();
# |
# | + auto *TdNakedPtrPtr = getPtrPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | auto &TdNakedRef = getRef();
# |
# | auto TdNakedRefDeref = getRef();
# |
# | - auto TdNakedCPtr = getCPtr();
# |
# | + const auto *TdNakedCPtr = getCPtr();
# |
# | //
# |
# | //
# |
# | - auto TdNakedCPtrPtr = getCPtrPtr();
# |
# | + auto *TdNakedCPtrPtr = getCPtrPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - auto &TdNakedCRef = getCRef();
# |
# | + const auto &TdNakedCRef = getCRef();
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -62,20 +62,20 @@
# | CMyRef getCRef();
# |
# |
# |
# | void foo() {
# |
# | - auto UNakedPtr = getPtr();
# |
# | + auto *UNakedPtr = getPtr();
# |
# | //
# |
# | //
# |
# | - auto UNakedPtrPtr = getPtrPtr();
# |
# | + auto *UNakedPtrPtr = getPtrPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | auto &UNakedRef = getRef();
# |
# | auto UNakedRefDeref = getRef();
# |
# | - auto UNakedCPtr = getCPtr();
# |
# | + const auto *UNakedCPtr = getCPtr();
# |
# | //
# |
# | //
# |
# | - auto &UNakedCRef = getCRef();
# |
# | + const auto &UNakedCRef = getCRef();
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -100,66 +100,66 @@
# | // make sure check disregards auto types that aren't pointers or references
# |
# | auto AutoInt = getInt();
# |
# |
# |
# | - auto NakedPtr = getIntPtr();
# |
# | + auto *NakedPtr = getIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - auto NakedCPtr = getCIntPtr();
# |
# | + const auto *NakedCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | - const auto ConstPtr = getIntPtr();
# |
# | + auto *const ConstPtr = getIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - const auto ConstCPtr = getCIntPtr();
# |
# | + const auto *const ConstCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | - volatile auto VolatilePtr = getIntPtr();
# |
# | + auto *volatile VolatilePtr = getIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - volatile auto VolatileCPtr = getCIntPtr();
# |
# | + const auto *volatile VolatileCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | auto *QualPtr = getIntPtr();
# |
# | - auto *QualCPtr = getCIntPtr();
# |
# | + const auto *QualCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - auto *const ConstantQualCPtr = getCIntPtr();
# |
# | + const auto *const ConstantQualCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - auto *volatile VolatileQualCPtr = getCIntPtr();
# |
# | + const auto *volatile VolatileQualCPtr = getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | - const auto *ConstQualCPtr = getCIntPtr();
# |
# | + const const auto *ConstQualCPtr = getCIntPtr();
# |
# |
# |
# | auto &Ref = *getIntPtr();
# |
# | - auto &CRef = *getCIntPtr();
# |
# | + const auto &CRef = *getCIntPtr();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | const auto &ConstCRef = *getCIntPtr();
# |
# |
# |
# | - if (auto X = getCIntPtr()) {
# |
# | + if (const auto *X = getCIntPtr()) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -187,7 +187,7 @@
# | for (auto &Data : Mutate) {
# |
# | change(Data);
# |
# | }
# |
# | - for (auto &Data : Constant) {
# |
# | + for (const auto &Data : Constant) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -197,14 +197,14 @@
# | }
# |
# |
# |
# | void loopPtr(const std::vector<int *> &Mutate, const std::vector<const int *> &Constant) {
# |
# | - for (auto Data : Mutate) {
# |
# | + for (auto *Data : Mutate) {
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# | change(*Data);
# |
# | }
# |
# | - for (auto Data : Constant) {
# |
# | + for (const auto *Data : Constant) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -215,7 +215,7 @@
# |
# |
# | template <typename T>
# |
# | void tempLoopPtr(std::vector<T *> &MutateTemplate, std::vector<const T *> &ConstantTemplate) {
# |
# | - for (auto Data : MutateTemplate) {
# |
# | + for (auto *Data : MutateTemplate) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -223,7 +223,7 @@
# | change(*Data);
# |
# | }
# |
# | //FixMe
# |
# | - for (auto Data : ConstantTemplate) {
# |
# | + for (const auto *Data : ConstantTemplate) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -236,7 +236,7 @@
# | class TemplateLoopPtr {
# |
# | public:
# |
# | void operator()(const std::vector<T *> &MClassTemplate, const std::vector<const T *> &CClassTemplate) {
# |
# | - for (auto Data : MClassTemplate) {
# |
# | + for (auto *Data : MClassTemplate) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -244,7 +244,7 @@
# | change(*Data);
# |
# | }
# |
# | //FixMe
# |
# | - for (auto Data : CClassTemplate) {
# |
# | + for (const auto *Data : CClassTemplate) {
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -397,13 +397,13 @@
# | //
# |
# | //
# |
# |
# |
# | - auto arr_not_ignored2 = new std::array<int, 4>::NotIgnored2();
# |
# | + auto *arr_not_ignored2 = new std::array<int, 4>::NotIgnored2();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | - auto not_ignored2 = new std::Ignored2();
# |
# | + auto *not_ignored2 = new std::Ignored2();
# |
# | //
# |
# | //
# |
# | //
# |
# | @@ -413,19 +413,19 @@
# | //
# |
# | //
# |
# |
# |
# | - auto not_ignored1 = new my::ns::NotIgnored1();
# |
# | + auto *not_ignored1 = new my::ns::NotIgnored1();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | - auto not2_ignored1 = new my::ns::NotIgnored2();
# |
# | + auto *not2_ignored1 = new my::ns::NotIgnored2();
# |
# | //
# |
# | //
# |
# | //
# |
# | //
# |
# |
# |
# | - auto not3_ignored1 = new my::Ignored1();
# |
# | + auto *not3_ignored1 = new my::Ignored1();
# |
# | //
# |
# | //
# |
# | //
# |
# |
# | ------------------------------------------------------------------
# | FileCheck -input-file=C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp.msg C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\readability\qualified-auto.cpp -check-prefixes=CHECK-MESSAGES -implicit-check-not={{warning|error}}: failed:
# | command line:1:22: error: IMPLICIT-CHECK-NOT: excluded string found in input
# |
# | -implicit-check-not='{{warning|error}}:'
# |
# | ^
# |
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp.msg:92:144: note: found here
# |
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:152:9: warning: 'auto *ConstQualCPtr' can be declared as 'const auto *ConstQualCPtr' [readability-qualified-auto]
# |
# | ^~~~~~~~
# |
# |
# |
# | Input file: C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp.msg
# |
# | Check file: C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\readability\qualified-auto.cpp
# |
# |
# |
# | -dump-input=help explains the following input dump.
# |
# |
# |
# | Input was:
# |
# | <<<<<<
# |
# | .
# |
# | .
# |
# | .
# |
# | 87: C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:147:3: warning: 'auto *volatile VolatileQualCPtr' can be declared as 'const auto *volatile VolatileQualCPtr' [readability-qualified-auto]
# |
# | 88: 147 | auto *volatile VolatileQualCPtr = getCIntPtr();
# |
# | 89: | ^
# |
# | 90: | const
# |
# | 91: C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:147:3: note: FIX-IT applied suggested code changes
# |
# | 92: C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:152:9: warning: 'auto *ConstQualCPtr' can be declared as 'const auto *ConstQualCPtr' [readability-qualified-auto]
# |
# | not:imp1 !~~~~~~~ error: no match expected
# |
# | 93: 152 | const auto *ConstQualCPtr = getCIntPtr();
# |
# | 94: | ^
# |
# | 95: | const
# |
# | 96: C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:152:9: note: FIX-IT applied suggested code changes
# |
# | 97: C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\qualified-auto.cpp.tmp.cpp:155:3: warning: 'auto &CRef' can be declared as 'const auto &CRef' [readability-qualified-auto]
# |
# | .
# |
# | .
# |
# | .
# |
# | >>>>>>
# |
# |
# `-----------------------------
# .---command stderr------------
# | Traceback (most recent call last):
# | File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 554, in <module>
# | main()
# | File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 550, in main
# | CheckRunner(args, extra_args).run()
# | File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 433, in run
# | self.check_messages(main_output)
# | File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 358, in check_messages
# | try_run(
# | File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 64, in try_run
# | process_output = subprocess.check_output(args, stderr=subprocess.STDOUT).decode(
# | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# | File "c:\python312\Lib\subprocess.py", line 466, in check_output
# | return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
# | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# | File "c:\python312\Lib\subprocess.py", line 571, in run
# | raise CalledProcessError(retcode, process.args,
# | subprocess.CalledProcessError: Command '['FileCheck', '-input-file=C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\tools\\extra\\test\\clang-tidy\\checkers\\readability\\Output\\qualified-auto.cpp.tmp.cpp.msg', 'C:\\_work\\llvm-project\\llvm-project\\clang-tools-extra\\test\\clang-tidy\\checkers\\readability\\qualified-auto.cpp', '-check-prefixes=CHECK-MESSAGES', '-implicit-check-not={{warning|error}}:']' returned non-zero exit status 1.
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.
https://github.com/llvm/llvm-project/pull/188196
More information about the cfe-commits
mailing list