JonasToth added inline comments.
================ Comment at: clang-tidy/performance/UnnecessaryCopyInitialization.cpp:65-66 has(varDecl(hasLocalStorage(), - hasType(matchers::isExpensiveToCopy()), + hasType(hasCanonicalType( + allOf(matchers::isExpensiveToCopy(), + unless(hasDeclaration(namedDecl( ---------------- baloghadamsoftware wrote: > JonasToth wrote: > > lebedev.ri wrote: > > > Does it matter whether we are calling `matchers::isExpensiveToCopy()` on > > > the type, or on the canonical type? > > the canonical type does resolve all typedefs, which is what is desirable in > > this case. > The real question is whether we want to match the canonical type to the list > of allowed type names. I am not sure. Well, very long template names are impractical, even for something "simple" as std::string the name gets very long without the typedef. I would say the typedefs should be respected https://reviews.llvm.org/D52727 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits