Index: clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp +++ clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp @@ -132,17 +132,20 @@ // because this requires special treatment (it could cause performance // regression) // + match for emplace calls that should be replaced with insertion - auto CallPushBack = cxxMemberCallExpr( - hasDeclaration(functionDecl(hasName("push_back"))), - on(hasType(cxxRecordDecl(hasAnyName(ContainersWithPushBack))))); - - auto CallPush = cxxMemberCallExpr( - hasDeclaration(functionDecl(hasName("push"))), - on(hasType(cxxRecordDecl(hasAnyName(ContainersWithPush))))); - - auto CallPushFront = cxxMemberCallExpr( - hasDeclaration(functionDecl(hasName("push_front"))), - on(hasType(cxxRecordDecl(hasAnyName(ContainersWithPushFront))))); + auto CallPushBack = + cxxMemberCallExpr(hasDeclaration(functionDecl(hasName("push_back"))), + on(hasType(hasCanonicalType(hasDeclaration( + namedDecl(hasAnyName(ContainersWithPushBack))))))); + + auto CallPush = + cxxMemberCallExpr(hasDeclaration(functionDecl(hasName("push"))), + on(hasType(hasCanonicalType(hasDeclaration( + namedDecl(hasAnyName(ContainersWithPush))))))); + + auto CallPushFront = + cxxMemberCallExpr(hasDeclaration(functionDecl(hasName("push_front"))), + on(hasType(hasCanonicalType(hasDeclaration( + namedDecl(hasAnyName(ContainersWithPushFront))))))); auto CallEmplacy = cxxMemberCallExpr( hasDeclaration(