Bug 1319330 - Ignore system headers for the implicit constructor check; r=mystor
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 22 Nov 2016 11:04:12 -0500
changeset 324121 cbbb7be5fe57914f4d266630482f0937e0fbb23c
parent 324120 4d48f8dd5d4ffc2afc2bf8d92e95be075401b873
child 324122 60fc8a86c409625e2f2c9f20b235e2be90a16b7d
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersmystor
bugs1319330
milestone53.0a1
Bug 1319330 - Ignore system headers for the implicit constructor check; r=mystor
build/clang-plugin/clang-plugin.cpp
--- a/build/clang-plugin/clang-plugin.cpp
+++ b/build/clang-plugin/clang-plugin.cpp
@@ -900,16 +900,18 @@ AST_MATCHER(CXXRecordDecl, needsMemMovab
 /// This matcher will select classes which require all members to be memmovable
 AST_MATCHER(CXXRecordDecl, needsMemMovableMembers) {
   return MozChecker::hasCustomAnnotation(&Node, "moz_needs_memmovable_members");
 }
 
 AST_MATCHER(CXXConstructorDecl, isInterestingImplicitCtor) {
   const CXXConstructorDecl *Declaration = Node.getCanonicalDecl();
   return
+      // Skip constructors in system headers
+      !ASTIsInSystemHeader(Declaration->getASTContext(), *Declaration) &&
       // Skip ignored namespaces and paths
       !isInIgnoredNamespaceForImplicitCtor(Declaration) &&
       !isIgnoredPathForImplicitCtor(Declaration) &&
       // We only want Converting constructors
       Declaration->isConvertingConstructor(false) &&
       // We don't want copy of move constructors, as those are allowed to be
       // implicit
       !Declaration->isCopyOrMoveConstructor() &&