================ @@ -0,0 +1,70 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "RedundantZeroInitializerCheck.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Expr.h" +#include "clang/AST/TypeLoc.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "clang/ASTMatchers/ASTMatchers.h" + +using namespace clang::ast_matchers; + +namespace clang::tidy::modernize { + +namespace { +// Matches an explicitly written ``{<single element>}`` list. ``isExplicit()`` +// excludes compiler-synthesized subobject lists (e.g. from brace elision in a +// multi-dimensional array), which are not written with braces in the source. +AST_MATCHER(InitListExpr, isSingleElementBracedList) { + return Node.isExplicit() && Node.getNumInits() == 1; +} + +// Matches an initializer list inside a macro expansion. ---------------- vbvictor wrote:
Remove redundant obvious comments https://github.com/llvm/llvm-project/pull/209367 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
