Bug 1557313 - Update ExplicitOperatorBoolChecker.cpp for clang trunk changes r=andi
authorDavid Major <dmajor@mozilla.com>
Thu, 06 Jun 2019 15:42:25 +0000
changeset 477640 201f4f4fe86e48f9d6b2ce27b728e3bbe11c89c0
parent 477639 49dfd67a3ba84d0c26fc59508c8ae0ee2c5bdbe7
child 477641 2d1aee4b08dce145e96fabaf8cadc3cc69a296f8
push id36119
push userncsoregi@mozilla.com
push dateThu, 06 Jun 2019 21:52:09 +0000
treeherdermozilla-central@6a81efd823db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersandi
bugs1557313, 360311
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1557313 - Update ExplicitOperatorBoolChecker.cpp for clang trunk changes r=andi https://reviews.llvm.org/rL360311 reworked the handling of `explicit` in `CXXConversionDecl`, and the `isExplicitSpecified()` method no longer exists. We can instead use `isExplicit()` which conveniently works on both old and new clangs. (Before 360311, `isExplicit()` just forwarded to `isExplicitSpecified()`.) Differential Revision: https://phabricator.services.mozilla.com/D33958
build/clang-plugin/ExplicitOperatorBoolChecker.cpp
--- a/build/clang-plugin/ExplicitOperatorBoolChecker.cpp
+++ b/build/clang-plugin/ExplicitOperatorBoolChecker.cpp
@@ -16,17 +16,17 @@ void ExplicitOperatorBoolChecker::regist
 }
 
 void ExplicitOperatorBoolChecker::check(
     const MatchFinder::MatchResult &Result) {
   const CXXConversionDecl *Method =
       Result.Nodes.getNodeAs<CXXConversionDecl>("node");
   const CXXRecordDecl *Clazz = Method->getParent();
 
-  if (!Method->isExplicitSpecified() &&
+  if (!Method->isExplicit() &&
       !hasCustomAttribute<moz_implicit>(Method) &&
       !ASTIsInSystemHeader(Method->getASTContext(), *Method) &&
       isInterestingDeclForImplicitConversion(Method)) {
     diag(Method->getBeginLoc(), "bad implicit conversion operator for %0",
          DiagnosticIDs::Error)
         << Clazz;
     diag(Method->getBeginLoc(), "consider adding the explicit keyword to %0",
          DiagnosticIDs::Note)