Index: clang-tidy/fuchsia/OverloadedOperatorCheck.cpp =================================================================== --- clang-tidy/fuchsia/OverloadedOperatorCheck.cpp +++ clang-tidy/fuchsia/OverloadedOperatorCheck.cpp @@ -30,8 +30,12 @@ } void OverloadedOperatorCheck::check(const MatchFinder::MatchResult &Result) { - if (const auto *D = Result.Nodes.getNodeAs("decl")) - diag(D->getLocStart(), "cannot overload %0") << D; + const auto *D = Result.Nodes.getNodeAs("decl"); + assert(D && "No FunctionDecl captured!"); + + SourceLocation Loc = D->getLocStart(); + if (Loc.isValid()) + diag(Loc, "cannot overload %0") << D; } } // namespace fuchsia Index: test/clang-tidy/fuchsia-overloaded-operator.cpp =================================================================== --- test/clang-tidy/fuchsia-overloaded-operator.cpp +++ test/clang-tidy/fuchsia-overloaded-operator.cpp @@ -16,3 +16,6 @@ A operator-(const A &A1, const A &A2); // CHECK-MESSAGES: [[@LINE-1]]:1: warning: cannot overload 'operator-' [fuchsia-overloaded-operator] + +void operator delete(void*, void*) throw(); +// CHECK-MESSAGES: [[@LINE-1]]:1: warning: cannot overload 'operator delete' [fuchsia-overloaded-operator]