[clang-tools-extra] [clang-tidy] comment braced-init list arguments (PR #180408)

Daniil Dudkin via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 15 15:07:00 PDT 2026


================
@@ -199,15 +204,62 @@ static const FunctionDecl *resolveMocks(const FunctionDecl *Func) {
   return Func;
 }
 
+namespace {
+
+enum class InitListKind {
+  None,
+  Anonymous,
+  Typed,
+};
+
+} // namespace
+
+static InitListKind getInitListKind(const Expr *Arg) {
+  Arg = Arg->IgnoreImplicit();
+
+  // Peel std::initializer_list wrappers until we reach the underlying
+  // list-initialization expression.
+  while (const auto *StdInit = dyn_cast<CXXStdInitializerListExpr>(Arg))
----------------
unterumarmung wrote:

You're right. I actually found a bug in the check, exploring possible options: it was missing a diagnostic for explicitly spelled `std::initializer_list` in the "typed" mode

https://github.com/llvm/llvm-project/pull/180408


More information about the cfe-commits mailing list