Closed as not planned
Description
Bugzilla Link | 39255 |
Version | trunk |
OS | MacOS X |
Extended Description
preprocessor blocks aren't formatted properly at all.
Example:
Before:
#if (defined(UNIX))
#define _FILE_OFFSET_BITS 64
#elif (defined _WIN32)
#define _UNICODE
#endif
After:
#if (defined(UNIX))
define _FILE_OFFSET_BITS 64
#elif (defined _WIN32)
#define _UNICODE
#endif
and let's say we're compiling on a UNIX platform, so the first branch of the preprocessor directive is enabled, but not the second.
Only the enabled block would actually be formatted, the disabled block is completely ignored.
I'm not sure if this is just because the formatter is running after the preprocessor, or if it's a lot deeper than that, and Clang is removing the unavailable preprocessor tokens before anyone else has access to it?