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

Francois Ferrand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 03:04:39 PST 2017

Typz added a comment.


So you mean a solution like the one discussed earlier would be the way to go?

> I mean that we can configure macros in the format style, like "define A(X) class X {". I'm not 100% sure whether we would just try to use the Preprocessor for this, or whether we'd want to only allow a small subset of actual macros, but the general idea would be the same: The UnwrappedLineParser would parse the macro at the expansion location A(X) into an unwrapped line, and then parse the expansion into a child line, with the tokens tha tare not in the argument of the call being marked as fixed (parent child might also be better inverted).

(As a side-note, I want to stress out that we would actually need a 'reversible' description to support the namespace case, to allow generating the end-of-namespace comment)

Is there any work on that side, any timeline when this may be supported ?


More information about the cfe-commits mailing list