[PATCH] D145138: [clang-tidy] Implement FixIts for C arrays

Chris Cotter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 1 18:47:41 PST 2023


ccotter added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp:532
+      // TODO: How can I get FileCheck to accept '{{}}' as a non-regex match?
+      FixIts.push_back(FixItHint::CreateInsertion(InitRange.getBegin(), "{ "));
+      FixIts.push_back(FixItHint::CreateInsertion(InitRange.getEnd(), " }"));
----------------
I could not figure out how to get FileCheck to handle `// CHECK-FIXES: std::array<int, 3> ar = {{0,1,2}};` without interpreting `{{` as the beginning of a regex. Is there a way to escape one of the curly braces?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145138/new/

https://reviews.llvm.org/D145138



More information about the cfe-commits mailing list