[PATCH] D44765: PR36643 Make clang-format support more generic TMarcos
Krasimir Georgiev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 27 13:34:03 PDT 2018
krasimir added a comment.
I don't have preferences over names, but I agree with Alex that the option should have more detailed description.
================
Comment at: lib/Format/FormatToken.h:138
+ /// \brief Whether this is a string literal similar to _T("sdfsdf").
+ bool TMacroStringLiteral = false;
+
----------------
We don't strictly need this new field. We could do as in the old implementation and check if the string prefix is from a T macro in ContinuationIndenter.
================
Comment at: unittests/Format/FormatTest.cpp:10693
+
+ // FIXME: This is required because parsing a configuration simply overwrites
+ // the first N elements of the list instead of resetting it.
----------------
Why is the `FIXME` here? I suggest just use the pattern similar to the other cases here and just keep the test with 2 elements:
```
Style.TMacros.clear();
std::vector<std::string> ExpectedTMacros = {"_T", "myT"};
CHECK_PARSE("TMacros: [_T, myT]", TMacros, ExpectedTMacros);
```
Repository:
rC Clang
https://reviews.llvm.org/D44765
More information about the cfe-commits
mailing list