[clang-tools-extra] [clang-tidy] Avoid evaluating value-dependent static initializers in fuchsia-statically-constructed-objects (PR #201287)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 3 01:30:44 PDT 2026


================
@@ -13,8 +13,9 @@ using namespace clang::ast_matchers;
 namespace clang::tidy::fuchsia {
 
 namespace {
-AST_MATCHER(Expr, isConstantInitializer) {
-  return Node.isConstantInitializer(Finder->getASTContext(), false);
+AST_MATCHER(Expr, isConstantOrValueDependentInitializer) {
+  return Node.isValueDependent() ||
----------------
vbvictor wrote:

I'd make a separate matcher for ValueDependent, I think we already have `isValueDependent` in https://clang.llvm.org/docs/LibASTMatchersReference.html.

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


More information about the cfe-commits mailing list