[PATCH] D137782: [clang-tidy]bugprone-fold-init-type

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 6 03:16:04 PDT 2023


PiotrZSL added a comment.

Missing ReleaseNotes,



================
Comment at: clang-tools-extra/clang-tidy/bugprone/FoldInitTypeCheck.cpp:41
+                    returns(hasCanonicalType(
+                        referenceType(pointee(BuiltinTypeWithId(ID))))),
+                    // `value_type operator*();`
----------------
referenceType(pointee -> references


================
Comment at: clang-tools-extra/clang-tidy/bugprone/FoldInitTypeCheck.cpp:43
+                    // `value_type operator*();`
+                    returns(hasCanonicalType(BuiltinTypeWithId(ID))),
+                    // `auto operator*();`, `decltype(auto) operator*();`
----------------
BuiltinTypeWithId already got hasCanonicalType, no need to duplicate


================
Comment at: clang-tools-extra/clang-tidy/bugprone/FoldInitTypeCheck.cpp:45
+                    // `auto operator*();`, `decltype(auto) operator*();`
+                    returns(hasCanonicalType(autoType(
+                        hasDeducedType(BuiltinTypeWithId(ID)))))))))))));
----------------
maybe:
```
returns(qualType(hasCanonicalType(anyOf(BuiltinTypeWithId(ID), references(BuiltinTypeWithId(ID)), autoType(hasDeducedType(BuiltinTypeWithId(ID)))
```
instead of having anyOf on top level.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137782



More information about the cfe-commits mailing list