================ @@ -207,11 +211,13 @@ void UseEmplaceCheck::registerMatchers(MatchFinder *Finder) { auto HasConstructExpr = has(ignoringImplicit(SoughtConstructExpr)); // allow for T{} to be replaced, even if no CTOR is declared - auto HasConstructInitListExpr = has(initListExpr(anyOf( - allOf(has(SoughtConstructExpr), - has(cxxConstructExpr(argumentCountIs(0)))), - has(cxxBindTemporaryExpr(has(SoughtConstructExpr), - has(cxxConstructExpr(argumentCountIs(0)))))))); + auto HasConstructInitListExpr = + has(initListExpr(anyOf(initCountIs(0), initCountIs(1)), ---------------- PiotrZSL wrote:
`initCountIs(1)` will work only if we got constructor that take that argument. ``` #include <vector> struct test { int a; }; int main() { std::vector<test> aa; aa.emplace_back(1); return 0; } ``` Code like this does not compile. https://github.com/llvm/llvm-project/pull/66169 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits