Author: prazek Date: Fri Apr 29 12:45:20 2016 New Revision: 268076 URL: http://llvm.org/viewvc/llvm-project?rev=268076&view=rev Log: small reformat to test access
Modified: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp Modified: clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp?rev=268076&r1=268075&r2=268076&view=diff ============================================================================== --- clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp (original) +++ clang-tools-extra/trunk/clang-tidy/modernize/PassByValueCheck.cpp Fri Apr 29 12:45:20 2016 @@ -128,33 +128,33 @@ void PassByValueCheck::storeOptions(Clan void PassByValueCheck::registerMatchers(MatchFinder *Finder) { // Only register the matchers for C++; the functionality currently does not // provide any benefit to other languages, despite being benign. - if (getLangOpts().CPlusPlus) { - Finder->addMatcher( - cxxConstructorDecl( - forEachConstructorInitializer( - cxxCtorInitializer( - // Clang builds a CXXConstructExpr only whin it knows which - // constructor will be called. In dependent contexts a - // ParenListExpr is generated instead of a CXXConstructExpr, - // filtering out templates automatically for us. - withInitializer(cxxConstructExpr( - has(declRefExpr(to( - parmVarDecl( - hasType(qualType( - // Match only const-ref or a non-const value - // parameters. Rvalues and const-values - // shouldn't be modified. - anyOf(constRefType(), - nonConstValueType())))) - .bind("Param")))), - hasDeclaration(cxxConstructorDecl( - isCopyConstructor(), unless(isDeleted()), - hasDeclContext( - cxxRecordDecl(isMoveConstructible()))))))) - .bind("Initializer"))) - .bind("Ctor"), - this); - } + if (!getLangOpts().CPlusPlus) + return; + + Finder->addMatcher( + cxxConstructorDecl( + forEachConstructorInitializer( + cxxCtorInitializer( + // Clang builds a CXXConstructExpr only whin it knows which + // constructor will be called. In dependent contexts a + // ParenListExpr is generated instead of a CXXConstructExpr, + // filtering out templates automatically for us. + withInitializer(cxxConstructExpr( + has(declRefExpr(to( + parmVarDecl( + hasType(qualType( + // Match only const-ref or a non-const value + // parameters. Rvalues and const-values + // shouldn't be modified. + anyOf(constRefType(), nonConstValueType())))) + .bind("Param")))), + hasDeclaration(cxxConstructorDecl( + isCopyConstructor(), unless(isDeleted()), + hasDeclContext( + cxxRecordDecl(isMoveConstructible()))))))) + .bind("Initializer"))) + .bind("Ctor"), + this); } void PassByValueCheck::registerPPCallbacks(CompilerInstance &Compiler) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits