[PATCH] D36354: [clang-tidy] Implement type-based check for `gsl::owner`

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 16 06:49:00 PDT 2017


aaron.ballman added inline comments.


================
Comment at: clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp:191
+  // Initialization of owners.
+  else if (OwnerInitialization != nullptr) {
+    diag(OwnerInitialization->getLocStart(),
----------------
aaron.ballman wrote:
> No else after a return. Same applies elsewhere.
Please remove the use of `CheckApplied`. The early returns were fine, it's the complex if/else logic that should be modified. e.g.,
```
if (OwnerAssignment) {
  <stuff>
  return true;
}

if (OwnerInitialization) {
  <stuff>
  return true;
}
...
return false;
```


https://reviews.llvm.org/D36354





More information about the cfe-commits mailing list