[clang-tools-extra] [clang-tidy] Fix bug in modernize-use-emplace (PR #66169)
Carlos Galvez via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 17 10:55:23 PDT 2023
================
@@ -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)),
----------------
carlosgalvezp wrote:
Nit: would it be simpler/more readable with something like `initCountLeq(1)`?
https://github.com/llvm/llvm-project/pull/66169
More information about the cfe-commits
mailing list