[PATCH] D23397: [clang-rename] cleanup `auto` usages

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 11 03:09:35 PDT 2016


omtcyfz created this revision.
omtcyfz added reviewers: alexfh, klimek.
omtcyfz added a subscriber: cfe-commits.

As Alexander pointed out, LLVM Coding Standards are more conservative about using `auto`, i.e. it should be used in the following situations:

* When the type is //obvious//, i.e. explicitly mentioned in the same expression. For example `if (const clang::FieldDecl *FieldDecl = Initializer->getMember())`
* When the type is totally non-obvious and one iterates over something. For example `for (const auto &CurrDecl : Context.getTranslationUnitDecl()->decls())`.

Otherwise the type should be explicitly stated.

https://reviews.llvm.org/D23397

Files:
  clang-rename/RenamingAction.cpp
  clang-rename/USRFinder.cpp
  clang-rename/USRFindingAction.cpp
  clang-rename/USRLocFinder.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23397.67666.patch
Type: text/x-patch
Size: 8370 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160811/a9c3f1d2/attachment-0001.bin>


More information about the cfe-commits mailing list