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())
16 void NoExplicitMoveConstructorChecker::check(
17 const MatchFinder::MatchResult
&Result
) {
18 // Everything we needed to know was checked in the matcher - we just report
20 const CXXConstructorDecl
*D
=
21 Result
.Nodes
.getNodeAs
<CXXConstructorDecl
>("node");
23 diag(D
->getLocation(), "Move constructors may not be marked explicit",
24 DiagnosticIDs::Error
);