Bug 1814798 - pt 1. Add bool to enable/disable PHC at runtime r=glandium
[gecko.git] / build / clang-plugin / NoExplicitMoveConstructorChecker.cpp
blob69e324dee3a42f900599cdb90588624e07a9a699
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "NoExplicitMoveConstructorChecker.h"
6 #include "CustomMatchers.h"
8 void NoExplicitMoveConstructorChecker::registerMatchers(
9 MatchFinder *AstMatcher) {
10 AstMatcher->addMatcher(
11 cxxConstructorDecl(isExplicitMoveConstructor(), isFirstParty())
12 .bind("node"),
13 this);
16 void NoExplicitMoveConstructorChecker::check(
17 const MatchFinder::MatchResult &Result) {
18 // Everything we needed to know was checked in the matcher - we just report
19 // the error here
20 const CXXConstructorDecl *D =
21 Result.Nodes.getNodeAs<CXXConstructorDecl>("node");
23 diag(D->getLocation(), "Move constructors may not be marked explicit",
24 DiagnosticIDs::Error);