OdysseyDecomp icon indicating copy to clipboard operation
OdysseyDecomp copied to clipboard

Custom linter: Disallow raw usage of `auto`, only allow `auto&` and `auto*`

Open MonsterDruide1 opened this issue 1 year ago • 1 comments

The game usually doesn't work with raw types in functions, but mostly references or pointers to objects (except Vector/Matrix, which can occur very often, but auto can be avoided here by using implicit constructors instead). While auto is not technically wrong and often still matches, it is still obscuring the unterlying type. Sometimes, this might be fine (for example new calls), but for these circumstances, we should still have the * or & directly annotated on the type, to avoid confusion.

MonsterDruide1 avatar Jun 05 '24 20:06 MonsterDruide1

https://clang.llvm.org/extra/clang-tidy/checks/readability/qualified-auto.html

MonsterDruide1 avatar Jun 08 '24 22:06 MonsterDruide1