[PATCH] D37813: clang-format: better handle namespace macros

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 07:55:12 PST 2017


klimek added a comment.

In https://reviews.llvm.org/D37813#942137, @Typz wrote:

> As far as "parsing" and formatting inside the block is concerned, this is indeed unrelated (and would totally work if all macros where specified with some preprocessor definitions).
>
> But identifying the 'opening' token and generating the matching 'closing' comment are totally related; it would seem very strange to have an option to specify that TESTSUITE() macros are parsed as namespace, then another option to indicate that namespace declared by this macros are actually closed with another macro call...


Putting the namespace into the macro gives the macro an abstraction - if somebody were to change, for example, the namespace portion with a class definition, would you still want the closing comments or not?


https://reviews.llvm.org/D37813





More information about the cfe-commits mailing list