3

I am doing some automated refactoring and I want to understand if some name is used in strings. E.g. in the code below I want to find all string literals containing substring "hello", which will yield me the first string.

int hello;
const char* str = "say hello";
const char* str2 = "say world";

I am using clang-query for this purpose. Seems like I need the stringLiteral matcher, but I cannot understand what narrowing or traversal matcher to pass into it to select only the literals with the given substring.

Mikhail
  • 20,685
  • 7
  • 70
  • 146

0 Answers0