[PATCH] D68436: [clang-scan-deps] Improve string/character literal skipping

Kousik Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 3 19:40:33 PDT 2019


kousikk added inline comments.


================
Comment at: clang/lib/Lex/DependencyDirectivesSourceMinimizer.cpp:205
+      return;
+    if (*First == '\\') {
+      if (++First == End)
----------------
Should you also check if the character right after a backslash is equal to Terminator and if it is, continue on without terminating? The case I'm thinking of is:

```
#define FOO "FOO \"doublequote\""
```

The testcase would be something like:

```
StringRef Source = "#define FOO \"FOO \\\"doublequote\\\"\"
... do rest
```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68436





More information about the cfe-commits mailing list