[clang] [clang][ASTMatcher] Add `matchesString` for `StringLiteral` which matches literals on given `RegExp` (PR #102152)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 7 06:09:32 PDT 2024
https://github.com/AaronBallman commented:
Thank you for this! I think we need to consider some more test cases though, because string literals aren't trivial. For example:
* Test the various string literal prefixes like `L` or `u`, etc. How should this work if the regular expression has a different encoding than the string literal?
* Test string literals that have been concatenated, like `"fo""obar"` to make sure they also match a regex like `foo.*`.
* Test string literals with embedded nulls to make sure the regex can still find matches after the null. e.g., `"foo\0bar"` as the string literal and `bar` as the regex.
https://github.com/llvm/llvm-project/pull/102152
More information about the cfe-commits
mailing list