aaron.ballman added subscribers: hans, aaron.ballman.
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM with a minor suggestion to not call `getLocStart()` twice and a formatting 
fix. I think you should also ping @hans to get this pulled into the 6.0 branch 
once it's been commit.



================
Comment at: clang-tidy/fuchsia/OverloadedOperatorCheck.cpp:33-37
+  if (const auto *D = Result.Nodes.getNodeAs<FunctionDecl>("decl")) {
+    if (D->getLocStart().isValid())
+      diag(D->getLocStart(), "cannot overload %0") << D;
+  }
 }
----------------
I think this code can be simplified to:
```
const auto *D = Result.Nodes...
assert(D && "No FunctionDecl captured!");

SourceLocation Loc = D->getLocStart();
if (Loc.isValid())
  diag(Loc, ...);
```


================
Comment at: test/clang-tidy/fuchsia-overloaded-operator.cpp:20
+
+void operator delete (void*, void*) throw();
+// CHECK-MESSAGES: [[@LINE-1]]:1: warning: cannot overload 'operator delete' 
[fuchsia-overloaded-operator]
----------------
Formatting is off -- this should be `operator delete(`... (no space after 
"delete").


https://reviews.llvm.org/D41708



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to