================
@@ -17,11 +17,21 @@ using namespace clang::ast_matchers;
namespace clang::tidy::modernize {
void ReturnBracedInitListCheck::registerMatchers(MatchFinder *Finder) {
- // Skip list initialization and constructors with an initializer list.
+ auto SemanticallyDifferentContainer = allOf(
+ argumentCountIs(2), hasArgument(0, hasType(isInteger())),
----------------
PiotrZSL wrote:
One more problem here, this check uses TK_IgnoreUnlessSpelledInSource, so if
first argument wont be integer but some class that got conversion operator to
integer, then with hasArgument you will see here actually that class.
This is a reason why I suggest to check constructor parameter instead of
argument type.
Simply do: ```hasDeclaration(cxxConstructorDecl(unless(parameterCountIs(0)),
hasParameter(0, hasType(...))))```
https://github.com/llvm/llvm-project/pull/68491
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits